CMS MADE SIMPLE FORGE

JQueryTools

 

[#11701] JQueryTools used in an custom module overwrites {$mod->GetModuleURLPath()}

avatar
Created By: Deleted User (deleteduser_11200)
Date Submitted: Tue Jan 16 11:36:45 -0500 2018

Assigned To: Robert Campbell (calguy1000)
Version: 1.4.0.3
CMSMS Version: 2.2.4
Severity: Minor
Resolution: Invalid
State: Open
Summary:
JQueryTools used in an custom module overwrites {$mod->GetModuleURLPath()}
Detailed Description:
* Behaviour:

When mixing JQueryTools with with scripts inside a private module. The
GetModuleURLPath is overwritten and pointing to:
 /module/JQueryTools/lib/

* Expected behaviour:

I expect  GetModuleURLPath to always point to the module from where the
templates are.


* How to reproduce:

<script src="{$mod->GetModuleURLPath()}/js/first_mymodulescript.js"></script>

{JQueryTools action="require" lib="fancybox" nocache}
{JQueryTools action="placemarker" nocache}

<script src="{$mod->GetModuleURLPath()}/js/another_mymodulescript.js"></script>

* Solution:

Perhaps this behaviour is by design I ended up using {capture} blocks, but filed
this for documentation.


History

Comments
avatar
Date: 2018-01-16 11:48
Posted By: Robert Campbell (calguy1000)

Module actions may overwrite the 'mod' smarty variable.   If you want to call a
module action AND use the $mod environment variable you need to save that
variable to another name.

{$mymod=$mod}

      
Updates

Updated: 2018-01-16 11:48
resolution_id: => 9