Originally posted by Scot - ScotsScripts.com
View Post
Announcement
Collapse
No announcement yet.
Debugging while module development
Collapse
X
-
-
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 )" />
Leave a comment:
-
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:
-
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:
-
Originally posted by Scot - ScotsScripts.com View PostDoesn't MvEVAL display output regardless of STANDARDOUTPUTLEVEL settings?
Leave a comment:
-
Even with
Code:STANDARDOUTPUTLEVEL = "text,html,compresswhitespace"
Leave a comment:
-
Doesn't MvEVAL display output regardless of STANDARDOUTPUTLEVEL settings?
Leave a comment:
-
FYI:
Since you didn't define an output level
STANDARDOUTPUTLEVEL=""
You wont see anything eval'd within the function.
Leave a comment:
-
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:
-
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> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p>"> <MvEVAL EXPR="{ '<p>Template filename: ' $ l.settings:template_filename $ '</p>' }">
Leave a comment:
-
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:
-
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>
Code:l.settings:template_filename
Tags: None
Leave a comment: