Thursday, 24 July 2014 00:29
beggarly

XML priority tag always zero for all plugin items

Report Xmap bugs on this forum.

XML priority tag always zero for all plugin items

Postby csommer » Tue Apr 22, 2008 12:07 pm

I cannot seem to get the XML sitemap to display the priority for items that are controlled by extensions. The change frequency responds correctly according to the individual settings but the priority is always set to zero regardless of what setting is specified.

Has anybody else had this problem?

I'm running Xmap 1.1 on Joomla 1.0.15, with the following extensions: Content 1.0.1, DOCman 1.0.2, Fireboard 1.0.0, Zoom 1.0.0.
csommer
Junior Boarder
Junior Boarder
 
Posts: 23
Joined: Sun Apr 13, 2008 11:26 pm

Re:XML priority tag always zero for all plugin items

Postby csommer » Thu Apr 24, 2008 9:02 am

If a priority setting of 1 is selected then it shows "1" in the priority tag. Any other setting produces "0" in the tag. If "Use Parent Menu Setting" is selected then the correct parent setting is shown. Could it be that the extension priority setting is being truncated after the first digit? After all, a parent menu priority of "0" produces "0.0" in the xml tag as opposed to simply "0".
csommer
Junior Boarder
Junior Boarder
 
Posts: 23
Joined: Sun Apr 13, 2008 11:26 pm

Re:XML priority tag always zero for all plugin ite

Postby lwillis » Thu Apr 24, 2008 6:58 pm

Me too!

The problem seems to be that the joomla seems to assume that numeric parameters are all whole numbers - see this fragment of code from includes/joomla.php

Code: Select all

if (!empty($return) && is_numeric($def)) {
// if value is defined and default value is numeric set variable type to integer
        $return = intval($return);
}


I guess the fix would be to store the parameters as whole numbers between 0 and 10 and divide by 10 when creating the XML file but that's a bit beyond me :(
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Re:XML priority tag always zero for all plugin ite

Postby lwillis » Thu Apr 24, 2008 9:38 pm

As a temporary fix you can use the following to get these working.

Code: Select all
$priority = mosGetParam($params,'prod_priority',$parent->priority);

with
Code: Select all
$priority =  $params['prod_priority'];


and

Code: Select all
$priority = mosGetParam($params,'cat_priority',$parent->priority);

with
Code: Select all
$priority =  $params['cat_priority'];


in the file
Code: Select all
administrator/components/com_xmap/extensions/com_virtuemart/com_virtuemart.php
- lines 36 and 46 respectively in the Joomla 1.0.x version.

This isn't the right fix as it bypasses some input sanitzation that should be done from a security point of view - but if you're administering your own site it's probably OK :)
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Re:XML priority tag always zero for all plugin ite

Postby guilleva » Thu Apr 24, 2008 9:42 pm

Hi, which version of Joomla/Xmap are you using, I can not reproduce the problem!!
User avatar
guilleva
Administrator
Administrator
 
Posts: 1527
Joined: Wed Sep 12, 2007 3:10 am
Location: San José, Costa Rica

Re:XML priority tag always zero for all plugin ite

Postby lwillis » Thu Apr 24, 2008 9:46 pm

Joomla v1.0.15, com_xmap v1.1, com_virtuemart extension v1.1
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Re:XML priority tag always zero for all plugin ite

Postby guilleva » Fri Apr 25, 2008 12:10 am

Thanks! Still I cannot reproduce the problem in that environment! :(

I'm going to keep trying!
User avatar
guilleva
Administrator
Administrator
 
Posts: 1527
Joined: Wed Sep 12, 2007 3:10 am
Location: San José, Costa Rica

Re:XML priority tag always zero for all plugin ite

Postby lwillis » Fri Apr 25, 2008 7:58 am

Hmmm, weird - do you have this bit of code in your includes/joomla.php

Code: Select all

if (!empty($return) && is_numeric($def)) {
// if value is defined and default value is numeric set variable type to integer
        $return = intval($return);
}


As that appears to be the culprit ...
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Re:XML priority tag always zero for all plugin ite

Postby csommer » Fri Apr 25, 2008 8:54 am

As mentioned above, I'm running Xmap 1.1 on Joomla 1.0.15 with these extensions: Docman 1.0.2, Foreboard 1.0.0 and Zoom 1.0.0.

Thanks, lwillis your suggestions work great for me. I tried it on the content plugin (1.0.1), com_content.php, and modified it as follow:

line 54:
Code: Select all
$priority = $params['cat_priority'];


line 65:
Code: Select all
$priority = $params['art_priority'];



For the Fireboard extention, com_fireboard.php, as follows:

line 28:
Code: Select all
$priority = $params['cat_priority'];


line 38:
Code: Select all
$priority = $params['topic_priority'];



I assume that this will work on the other extensions I'm using too.
csommer
Junior Boarder
Junior Boarder
 
Posts: 23
Joined: Sun Apr 13, 2008 11:26 pm

Re:XML priority tag always zero for all plugin ite

Postby lwillis » Fri Apr 25, 2008 7:52 pm

Should do - although it's not the right fix ....
lwillis
Fresh Boarder
Fresh Boarder
 
Posts: 10
Joined: Thu Apr 24, 2008 7:54 pm

Next

Return to Bugs



Who is online

Users browsing this forum: Exabot [Bot] and 7 guests

cron