Cache Module

Luca
Luca
Offline
0
Hi Germi..

to make the cache of module "Recently Added artist" I added these lines in the xml file:

		
param name="cache" type="list" default="1" label="Caching" description="Select whether to cache the content of this module"
option value="1">Use global/option
option value="0">No caching/option
/param



But once I set the cache on management module when I open the page where the module is contained appears this error:

Fatal error: Using $this when not in object context in modules\\mod_muscol_recently_added_artists\\helper.php on line 16

In this line the code is:

if (empty( $this->_latest_artists_data )) {



can you help me?
Responses (3)
  • Accepted Answer

    Luca
    Luca
    Offline
    Friday, June 18 2010, 11:19 PM - #Permalink
    0
    If I replace all string:

    $this


    with

    $db


    the error is resolved and the cache works.
    But it is the right way to solve the problem?
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, June 19 2010, 09:53 AM - #Permalink
    0
    "$this" should be simply cropped out. it shouldnt be used on modules (this is an old module and needs to be updates.

    DONT replace $this with $db!!!!!!!!!!!!!!!!!!!

    just delete THIS

    so $this->_latest_artists_data

    should become

    $latest_artists_data
    The reply is currently minimized Show
  • Accepted Answer

    Luca
    Luca
    Offline
    Saturday, June 19 2010, 10:14 AM - #Permalink
    0
    Very Thanks Germi! :-)
    The reply is currently minimized Show
Your Reply