Adding "Link Image" To A Menu Item Page Causes Blank Page With Error "0 Cannot Access Protected Property Joomla\CMS\Menu\MenuItem::$params" - Question | JoomShaper

Adding "Link Image" To A Menu Item Page Causes Blank Page With Error "0 Cannot Access Protected Property Joomla\CMS\Menu\MenuItem::$params"

EU

Eric Uhl

Template 2 years ago

I'm building a new site with Joomla and have come across what I think is a bug. As soon as I add an image to the "Link Image" field in a menu item's "Link Type" tab, the front end of the site has a white blank page and produces this error:

0 Cannot access protected property Joomla\CMS\Menu\MenuItem::$params

If I turn on maximum reporting I get no more information. Any ideas on what's going on here or the nexts steps I could take to fix this issue?

1
6 Answers
Rashida Rahman
Rashida Rahman
Accepted Answer
Support Agent 2 years ago #36401

Hi there!

Thanks for contacting us.

Which template you are using, please? And your system information? This error indicates conflict with Joomla version as per my knowledge.

Best Regards

0
EU
Eric Uhl
Accepted Answer
2 years ago #36405

Thanks Rashida, I'm using the Helix Ultimate v2.0.5 template.

Here is all my system information.

PHP Built On Darwin Alfred.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:11 PDT 2020; root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64 Database Type mysql Database Version 5.7.34 Database Collation utf8_general_ci Database Connection Collation utf8mb4_general_ci Database Connection Encryption None Database Server Supports Connection Encryption Yes PHP Version 7.4.21 Web Server Apache/2.4.48 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/7.4.21 OpenSSL/1.0.2u mod_wsgi/3.5 Python/2.7.13 WebServer to PHP Interface apache2handler Joomla! Version Joomla! 4.0.3 Stable [ Furaha ] 12-September-2021 10:39 GMT User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0

Again, everything works just fine until I add an link image on any menu item. Soon as I add an image and save, ALL front end pages break and display the error "0 Cannot access protected property Joomla\CMS\Menu\MenuItem::$params" Let me know if anything looks incorrect, otherwise is this where I would report a bug?

0
S
ssnobben
Accepted Answer
1 year ago #71148

Hi

I have the same problem with SP Pagebuilder 4.0.0-RC.2 Helix Ultimate 2.0.9 Joomla 4.1.4

Please explain the fix.

Please explain the fix.

Here is code there /html/templates/shaper_helixultimate/features/title.php:

/**

defined ('_JEXEC') or die();

use Joomla\CMS\Factory; use Joomla\CMS\Uri\Uri;

/**

  • Helix Ultimate Site Title.

  • @since 1.0.0 */ class HelixUltimateFeatureTitle { /**

    • Template parameters
    • @var object $params The parameters object
    • @since 1.0.0 */ private $params;

    /**

    • Constructor function
    • @param object $params The template parameters
    • @since 1.0.0 */ public function __construct($params) { $this->position = 'title'; }

    /**

    • Render the logo features.

    • @return string

    • @since 1.0.0 */ public function renderFeature() {

      $app = Factory::getApplication(); $menuitem = $app->getMenu()->getActive();

      if($menuitem) {

       $params = $menuitem->getParams();
      
       if($params->get('helixultimate_enable_page_title', 0))
       {
      
           $page_title          = $menuitem->title;
           $page_heading        = $params->get('helixultimate_page_title_heading', 'h2');
           $page_title_alt      = $params->get('helixultimate_page_title_alt');
           $page_subtitle       = $params->get('helixultimate_page_subtitle');
           $page_title_bg_color = $params->get('helixultimate_page_title_bg_color');
           $page_title_bg_image = $params->get('helixultimate_page_title_bg_image');
      
           if($page_heading == 'h1')
           {
               $page_sub_heading = 'h2';
           }
           else
           {
               $page_sub_heading = 'h3';
           }
      
           $style = '';
      
           if($page_title_bg_color)
           {
               $style .= 'background-color: ' . $page_title_bg_color . ';';
           }
      
           if($page_title_bg_image)
           {
               $style .= 'background-image: url(' . Uri::root(true) . '/' . $page_title_bg_image . ');';
           }
      
           if($style)
           {
               $style = 'style="' . $style . '"';
           }
      
           if($page_title_alt)
           {
               $page_title      = $page_title_alt;
           }
      
           $output = '';
      
           $output .= '<div class="sp-page-title"'. $style .'>';
           $output .= '<div class="container">';
      
           $output .= '<'. $page_heading .' class="sp-page-title-heading">'. $page_title .'</'. $page_heading .'>';
      
           if($page_subtitle)
           {
               $output .= '<'. $page_sub_heading .' class="sp-page-title-sub-heading">'. $page_subtitle .'</'. $page_sub_heading .'>';
           }
      
           $output .= '<jdoc:include type="modules" name="breadcrumb" style="none" />';
      
           $output .= '</div>';
           $output .= '</div>';
      
           return $output;
      
       }

      }

    } }

0
CD
Carlos Diaz
Accepted Answer
1 year ago #85697

Hi there,

I am having the same error.

Could you please help out?

Best,

Carlos

0
S
ssnobben
Accepted Answer
1 year ago #85699

sorry not get fixed.. create support ticket.

0
CD
Carlos Diaz
Accepted Answer
1 year ago #85703

Ok, I will roll back to previous installation and will try again. It would be wonderful if you could give more hints about what could be the problem. It looks like it could be the template. Not sure. All in all thanks!

0