The Joomla! Forum ™



Forum rules


Please use the Forum Post Assistant to give your server setting details which are necessary to determine the problem.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
PostPosted: Thu Aug 12, 2010 2:10 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 30, 2010 8:13 am
Posts: 26
Hello all,

I am developing a module for Joomla 1.6 but I am running in to a problem which I believe is being caused by a cache problem.

I am adding javascript declarations as follows in the default.php file of the module

Code:
$document =& JFactory::getDocument();
$document->addScript('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
$document->addScript('http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js');
$document->addScript(JURI::root().'modules'.DS.'mod_portlets'.DS.'js'.DS.'jquery.cookie.js');
$document->addScript(JURI::root().'modules'.DS.'mod_portlets'.DS.'js'.DS.'portlets.js');


This is great at first and the module works fine, but after refreshing a few times or navigating to a different page the module stops working, after investigating with FireBug I realised the JS files were not being inculded in the head anymore.

If I un-publish and re-publish the module then the JS files pop back into the head and the module works as it should, but again after a page or two they disappear again.

The only thing I could think of is that it is some sort of cache issue since the rest of the php for the module seems fine and the module is displaying, just without the JS elements.

Can anyone offer any solutions or reasons as to why this might happen?

Thanks


Top
 Profile  
 
PostPosted: Thu Aug 12, 2010 3:27 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Sun Feb 28, 2010 8:26 pm
Posts: 1026
Location: Clarksville, TN
There are a few known cache issues with 1.6 right now. If you turn off the cache in the Global Config then clear your site's cache, you should have no issues for the time being.

_________________
Joomla! Production Leadership Team
http://www.babdev.com
Unsolicited PMs will be ignored
Follow me @mbabker


Top
 Profile  
 
PostPosted: Thu Aug 12, 2010 3:39 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jun 30, 2010 8:13 am
Posts: 26
Thanks for the reply.

I stuck in the same cache params that I had seen in other modules like this...

Code:
   <config>
      <fields name="params">
         <fieldset name="cache">
            <field
               name="cache"
               type="list"
               default="1"
               label="COM_MODULES_FIELD_CACHING_LABEL"
               description="COM_MODULES_FIELD_CACHING_DESC">
               <option
                  value="1">JGLOBAL_USE_GLOBAL</option>
               <option
                  value="0">COM_MODULES_FIELD_VALUE_NOCACHING</option>
            </field>
            <field
               name="cache_time"
               type="text"
               default="900"
               label="COM_MODULES_FIELD_CACHE_TIME_LABEL"
               description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
            <field
               name="cachemode"
               type="hidden"
               default="static">
               <option
                  value="static"></option>
                </field>
         </fieldset>
      </fields>
   </config>


But it made no difference, which makes me believe it is a cache bug.

The only thing that did work is turning the cache off as you suggested.

Cheers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 



Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group