Announcement

Collapse
No announcement yet.

Debugging while module development

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bruce - PhosphorMedia
    replied
    Originally posted by Scot - ScotsScripts.com View Post
    Doesn't MvEVAL display output regardless of STANDARDOUTPUTLEVEL settings?
    oh, yea...i was confusing that with just entering say, "<p>Hello World</p>" in a function. as i mentioned, i rarely use that method preferring to place that type of output into a variable...which is why I love <mvcapture> so much. :)

    Leave a comment:


  • compumate99
    replied
    Thanks for all your help.

    Code:
    <mvt:if expr="sexists('/debug.log')>
        < mvt:assign name="l.ok" value="sdelete('/debug.log')" />
    < /mvt:if>
    < mvt:assign name="l.ok" value="file_create( '/debug.log', 'script',l.settings:template_filename )" />
    This works beautifully.

    Leave a comment:


  • ids
    replied
    I don't think the function: ComponentModule_Page_Assign
    has anywhere to display when an eval function executes. Or, the screen gets overwritten during the ensuing function. Therefore, I suggest to use Kent's alternate suggestion which is to export the data you want to capture in a file. I do this quite a bit even when printing to the screen works because it sometimes breaks the screen anyway.

    Scott

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    MvEVAL does display values regardless of STANDARDOUTPUT level. If you're not seeing the values then there is no value, OR, it's being displayed up above the top fold and you need to add some whitepace to the top as per Kent's post. It's not easy to see what's going on in the admin because you need to add about 250px of whitepace to the top of the output since the top of the admin content frame is covered by the navbar frame (or something like that.)

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    Originally posted by Scot - ScotsScripts.com View Post
    Doesn't MvEVAL display output regardless of STANDARDOUTPUTLEVEL settings?
    hasn't been my experiance my i rarely eval directly from a function so we are relying on memories...

    Leave a comment:


  • compumate99
    replied
    Even with
    Code:
    STANDARDOUTPUTLEVEL = "text,html,compresswhitespace"
    It does not display anything.

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    Doesn't MvEVAL display output regardless of STANDARDOUTPUTLEVEL settings?

    Leave a comment:


  • Bruce - PhosphorMedia
    replied
    FYI:

    Since you didn't define an output level

    STANDARDOUTPUTLEVEL=""

    You wont see anything eval'd within the function.

    Leave a comment:


  • compumate99
    replied
    Thanks Scot and Kent

    Displaying information using <MvEVAL> and javascript alert did not work, but logging using debug.log file worked for me.

    <MvEVAL> also worked in ComonentModule_Content function.

    Thanks.
    Last edited by compumate99; 09-12-19, 07:51 AM.

    Leave a comment:


  • Kent Multer
    replied
    I sometimes put MvEVAL's right in my code to display variables on my screen for debugging. Since this is an admin operation, the module needs to output some white space before the variable; otherwise it will be displayed in a place that is hidden by other page elements.
    Code:
    <MvEVAL EXPR="<p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p>">
    <MvEVAL EXPR="{ '<p>Template filename: ' $ l.settings:template_filename $ '</p>' }">
    HTH --

    Leave a comment:


  • Scot - ScotsScripts.com
    replied
    You could try evaluating it at the bottom of the function (above the function return):

    <mvt:eval expr="l.settings:template_filename" />

    If that doesn't work or you can't find where it displayed (viewing page/frame source sometimes works) you can try doing a javascript alert just before the function return:

    <mvt:eval expr="'<script> alert("' $ l.settings:template_filename $ ' $");</script>'" />

    Another option is to export the data file using the various file functions.

    <mvt:if expr="sexists('/debug.log')>
    <mvt:assign name="l.ok" value="sdelete('/debug.log')" />
    </mvt:if>
    <mvt:assign name="l.ok" value="file_create( '/debug.log', 'script',l.settings:template_filename )" />

    Then open the debug file either by browsing to it (domain.com/debug.log) or ftp'ing into the site and viewing it that way.

    Leave a comment:


  • compumate99
    started a topic Debugging while module development

    Debugging while module development

    Hello experts,

    I am developing component module and having some issue.

    Code:
    <MvFUNCTION NAME = "ComponentModule_Page_Assign" PARAMETERS = "module var, page var, item, settings var" STANDARDOUTPUTLEVEL = "">
     <MvEVAL EXPR = "{ Generate_Code_List( l.template_source ) }">
     <MvASSIGN NAME = "l.settings:template_filename" VALUE = "{ tolower( l.page:code ) $ '-' $ tolower( l.item ) $ '.mvc' }">
     <MvASSIGN NAME = "l.settings:template_id"  VALUE = "{ [ g.Module_Feature_TUI_MGR ].TemplateManager_Create_ManagedTemplate_NoDuplicates( l.template_source, l.settings, l.settings:template_filename ) }">
     <MvIF EXPR = "{ l.settings:template_id EQ 0 }">
      <MvFUNCTIONRETURN VALUE = 0>
     </MvIF>
     <MvIF EXPR = "{ NOT [ g.Module_Feature_TUI_MGR ].TemplateManager_Page_Assign_Item( l.page, l.item ) }">
      <MvFUNCTIONRETURN VALUE = 0>
     </MvIF>
    
     <MvFUNCTIONRETURN VALUE = 1>
    </MvFUNCTION>
    Is there simple way to test the value from develop machine?

    Code:
    l.settings:template_filename
    Thanks in advance
Working...
X