Saturday, 30 August 2014 08:31
beggarly

News sitemap bug with xmap 1.2.3

Report Xmap bugs on this forum.

News sitemap bug with xmap 1.2.3

Postby Greg » Fri Dec 11, 2009 10:40 am

Hello,

just install the new Xmap 1.2.3

Everything ok, except that google refuse the News Sitemap because of lacks of the language tag.
Missing XML tag
This required tag is not found. Add it and try again.

Code: Select all
<n:language></n:language>


Ans I see in xmap.xml.php that this code is commented:
Code: Select all
                 // echo "   <n:language>en</n:language>\n";


Not normal I suppose ?
Joomla 1.5.22 / 2.5.7 | VM 2.0.12b | Xmap 1.2.14 / 2.3.0 | PHP5.3.17
Greg
Senior Boarder
Senior Boarder
 
Posts: 50
Joined: Sun Sep 16, 2007 7:42 pm

Re: News sitemap bug with xmap 1.2.3

Postby Greg » Fri Dec 11, 2009 11:03 am

ok

on line 26 done this:
Code: Select all
      $this->language = $app->getCfg('language');


And on line 95 change for this:
Code: Select all
                 echo "   <n:language>",htmlspecialchars($this->language),"</n:language>\n";


and now the sitemap seems ok, as we got:
Code: Select all
<n:language>fr-FR</n:language>


Do you agree ?
Joomla 1.5.22 / 2.5.7 | VM 2.0.12b | Xmap 1.2.14 / 2.3.0 | PHP5.3.17
Greg
Senior Boarder
Senior Boarder
 
Posts: 50
Joined: Sun Sep 16, 2007 7:42 pm

Re: News sitemap bug with xmap 1.2.3

Postby guilleva » Fri Dec 11, 2009 3:07 pm

Hi Greg, thanks for your patch, It looks good to me, I guess I forgot to finish that part!

I have added your patch and released a new version which also fixes an installation error when it's the fist time that Xmap is installed.

Please let me know if you see something else wrong!

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

Re: News sitemap bug with xmap 1.2.3

Postby Greg » Fri Dec 11, 2009 3:46 pm

Great !
Unfortunately just checked about the code language needed an google say that it must be only 2 or 3 letters.
The <language> is the language of your publication. It should be an ISO 639 Language Code (either 2 or 3 letters). Exception: For Chinese, please use zh-cn for Simplified Chinese or zh-tw for Traditional Chinese.


http://www.google.com/support/news_pub/ ... swer=74288

So for me "fr-FR" seems not good, I think we must put some regex here, or if you want, and I think this is the better way, add this as a parameter in Xmap configuration.

Will try to do this on my own site and let you know ;)
Perhaps you'll finish it before me :D
Joomla 1.5.22 / 2.5.7 | VM 2.0.12b | Xmap 1.2.14 / 2.3.0 | PHP5.3.17
Greg
Senior Boarder
Senior Boarder
 
Posts: 50
Joined: Sun Sep 16, 2007 7:42 pm

Re: News sitemap bug with xmap 1.2.3

Postby Greg » Sat Dec 12, 2009 1:03 am

ok, something that do the trick for the language specifications.

I suggest for the line 26 to replace by:
Code: Select all
      $this->language = explode("-", $app->getCfg('language'), 2);


And for line 95 by:
Code: Select all
                 echo "   <n:language>",htmlspecialchars($this->language[0]),"</n:language>\n";


And so, that's good, instead of "fr-FR" I got only the "fr"

Some test welcome from users
Joomla 1.5.22 / 2.5.7 | VM 2.0.12b | Xmap 1.2.14 / 2.3.0 | PHP5.3.17
Greg
Senior Boarder
Senior Boarder
 
Posts: 50
Joined: Sun Sep 16, 2007 7:42 pm

Re: News sitemap bug with xmap 1.2.3

Postby guilleva » Sat Dec 12, 2009 6:23 pm

Hi Greg, thanks for your feedback, it's really appreciated as I have no way to test it with Google. I will update the component to fix this issue.
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 2 guests

cron