Friday, 25 July 2014 18:15
beggarly

[Patch] Undefined property: stdClass::$priority and $changef

Report Xmap bugs on this forum.

[Patch] Undefined property: stdClass::$priority and $changef

Postby fredo » Thu Oct 06, 2011 4:50 pm

Hi,

I use Xmap 2.0 with Joomla 1.7.1 and PHP 5.3.3.

For some links in the site map (HTML and XML) I have two notices in PHP log :

Code: Select all
PHP Notice:  Undefined property: stdClass::$priority in /var/www/[...]/joomla-1.7.1/components/com_xmap/displayer.php on line 135

PHP Notice:  Undefined property: stdClass::$changefreq in /var/www/[...]/joomla-1.7.1/components/com_xmap/displayer.php on line 136


Those surprises me is that I do not have two notices for all links of site map and I not see any connection between the links


Regards.
Last edited by fredo on Wed Oct 19, 2011 10:48 am, edited 1 time in total.
fredo
Fresh Boarder
Fresh Boarder
 
Posts: 7
Joined: Wed Aug 31, 2011 3:35 pm

Re: Undefined property: stdClass::$priority and $changefreq

Postby fredo » Tue Oct 18, 2011 9:34 am

Hi,

I found the problem, it appears when I insert a separator in the menus. For each separator there are two PHP notices.

In the course of the menus, do not take into account the type separator.

Regards.
fredo
Fresh Boarder
Fresh Boarder
 
Posts: 7
Joined: Wed Aug 31, 2011 3:35 pm

Re: Undefined property: stdClass::$priority and $changefreq

Postby fredo » Wed Oct 19, 2011 10:47 am

Hi,

The initialization problem can be corrected by this code:

In the file "components/com_xmap/helpers/xmap.php", line 89, replace :

Code: Select all
if ($item->type != 'separator') {
      $item->priority = $menuOptions['priority'];
      $item->changefreq = $menuOptions['changefreq'];

      XmapHelper::prepareMenuItem($item);
}


by:

Code: Select all
if ($item->type != 'separator') {
      $item->priority = $menuOptions['priority'];
      $item->changefreq = $menuOptions['changefreq'];

      XmapHelper::prepareMenuItem($item);
}
else {
      $item->priority = '';
      $item->changefreq = '';
}



Regards.
fredo
Fresh Boarder
Fresh Boarder
 
Posts: 7
Joined: Wed Aug 31, 2011 3:35 pm

Re: [Patch] Undefined property: stdClass::$priority and $cha

Postby guilleva » Sat Nov 26, 2011 12:02 am

Great, thanks for sharing it!! I have added the fix to repository:
https://github.com/guilleva/Xmap/commit/7ae312780fd3ce72c5986f23813535742300f49e

Regards,

Guillermo
User avatar
guilleva
Administrator
Administrator
 
Posts: 1527
Joined: Wed Sep 12, 2007 3:10 am
Location: San José, Costa Rica


Return to Bugs



Who is online

Users browsing this forum: No registered users and 7 guests