Error on spbooking - Forum | JoomShaper
Staff replied Extensions

Error on spbooking

Asked by Pasquale 5 years ago Last activity 5 years ago

Hy, I have this problem.

Notice: Trying to get property 'params' of non-object in C:\wamp64\www\travel_savadori1\components\com_spbooking\models\packages.php on line 22

Description:
$menu = $app->getMenu()->getActive();
line22 ==> $mParams = $menu->params;
$cParams = JComponentHelper::getParams('com_spbooking');

How can I solve the problem?

Thanks

8 replies

Ofi Khan Staff

Hello Pasquale

Please go to this location: C:\wamp64\www\travel_savadori1\components\com_spbooking\models and replace packages.php file with the attached file. You need to unzip the file and replace.

unzip_packages.zip

Best regards

Pasquale Asked this

now the page "daily tour" does not open, the error is the following:
syntax error, unexpected '[', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

I think the problem is here,
$mParams = $menu->['params'];

 Can you help me.
 Thanks
Pasquale Asked this

the code:

$this->setState('list.start', $app->input->get('limitstart', 0, 'uint'));
        $this->setState('filter.language', JLanguageMultilang::isEnabled());
        $menu = $app->getMenu()->getActive();
        var_dump($menu->params);
        if(isset($menu) && isset($menu->params)){
            $mParams = $menu->params;
        }
        $cParams = JComponentHelper::getParams('com_spbooking');
        $limit = $cParams->get('packages_limit', 6);

code execution

`C:\wamp64\www\travel_savadori1\components\com_spbooking\models\packages.php:22:

object(Joomla\Registry\Registry)[404]
protected 'data' =>
object(stdClass)[406]
public 'limit' => string '6' (length=1)
public 'columns' => string '2' (length=1)
public 'menu-anchor_title' => string '' (length=0)
public 'menu-anchor_css' => string '' (length=0)
public 'menu_image' => string '' (length=0)
public 'menu_image_css' => string '' (length=0)
public 'menu_text' => int 1
public 'menu_show' => int 1
public 'page_title' => string '' (length=0)
public 'show_page_heading' => string '' (length=0)
public 'page_heading' => string '' (length=0)
public 'pageclass_sfx' => string '' (length=0)
public 'menu-meta_description' => string '' (length=0)
public 'menu-meta_keywords' => string '' (length=0)
public 'robots' => string '' (length=0)
public 'secure' => int 0
public 'helixultimatemenulayout' => string '{"width":600,"menualign":"right","megamenu":0,"showtitle":1,"faicon":"","customclass":"","dropdown":"right","badge":"","badge_position":"","badge_bg_color":"","badge_text_color":"","layout":[]}' (length=193)
public 'helixultimate_enable_page_title' => string '1' (length=1)`

the original code works but when clicking on the submit button of the search component you get the following error

Trying to get property 'params' of non-object in C:\wamp64\www\travel_savadori1\components\com_spbooking\models\packages.php on line 22

Ofi Khan Staff

Please use the previous code and turn off Error Reporting for a quick fix. This notice will not hamper the site functionality.

Screenshot_8.png

Pasquale Asked this

Running his suggestion does not show the error but persists. In fact, now in the search form only the date is displayed and the first part with two other parameters are cut.
How can I value the parameter $ mParams = $ menu-> params; which turned out to be null after hitting the submit button

Ofi Khan Staff

Which PHP version are you using? Switch to PHP 7.3 or lower to check the issue.

Pasquale Asked this
5 years ago · edited

![]()I tried to change the php version with different versions but nothing .. I also cleared the cache but nothing. the problem is not solved. how can I get that parameter to be valued.

Ofi Khan Staff

In which page do you see the error? Share that page link and your administrator access here to check. Use Hidden Content box to share the credentials.

Log in to reply.