Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • 3dsystem Friend
    #157302

    Hi! I have a simple problem with Ja_News Frontpage module, but can’t fix it myself. Module work’s fine when a cache is disabled, but when I enable it in module settings, server returns following error:

    Call to a member function get() on a non-object in D:AppServwwwmodulesmod_janews_fphelpershelper.php on line 36

    line 36

    if ( $params->get('cache') == "1" && $use_cache == "1") {

    beginning of the helper.php

    class modJaNewsFrontpageHelper extends JObject {
    var $_module = null;
    var $_params = null;
    var $articles = array();
    var $total = 0;

    function __construct($module, $params = null) {
    $this->_module = $module;
    $this->loadConfig($params);
    }

    public function loadConfig($params, $modulename = "mod_janews_fp")
    {
    global $mainframe;
    $use_cache = $mainframe->getCfg("caching");
    $this->mod_params = $params;
    if ( $params->get('cache') == "1" && $use_cache == "1") {
    $cache =& JFactory::getCache();
    $cache->setCaching( true );
    $cache->setLifeTime( $params->get( 'cache_time', 30 ) * 60 );
    $this->_params = $cache->get( array( (new modJaNewsFrontpageHelper() ) , 'loadProfile' ), array( $params, $modulename ) );
    } else {
    $this->_params = $this->loadProfile( $params, $modulename );
    }
    }

    Please help

    thuanlq Friend
    #366248

    Hi,

    Your problem was bug of mod_janews_fp module. you can resolve this problem as following:
    Change code


    //location mod_janews_fp/helpers/helper.php
    function __construct($module, $params = null) {
    $this->_module = $module;
    $this->loadConfig($params);
    }

    To


    //location mod_janews_fp/helpers/helper.php
    function __construct($module = null, $params = null) {
    $this->_module = $module;
    if(!empty($params))
    {
    $this->loadConfig($params);
    }
    }

    3dsystem Friend
    #367350

    Thanks, works fine. I’ve found the same bug in janews_pro.

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  3dsystem 7 years, 12 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum