Incompatibility with XML sitemap 2.x

AFowle - June 13, 2009 - 08:01
Project:Gallery
Version:6.x-1.x-dev
Component:Code / API
Category:bug report
Priority:normal
Assigned:Dave Reid
Status:needs review
Description

I have reported an error with the XML Sitemap project. The maintainer says that this is an issue with Gallery's implementation of hook_xmlsitemap_links(). I don't know if this is a problem with the Gallery module or the Gallery program itself. Any chance of a fix For this?

See http://drupal.org/node/490478

#1

kiamlaluno - June 13, 2009 - 13:06
Title:XML Sitemap Array processing errors with Gallery» Incompatibility with XML sitemap 2.x

The error is caused by the fact hook_xmlsitemap_links() is changed within version 2.x.

When this module has been created, XML sitemap 2.x didn't even exist. I think that for the maintainer of this module is hard to detect which version of XML sitemap is installed in the site that uses this module. XML sitemap should consider a different approach on how calling the hook it uses, or use a different hook name, if the way it is used is not compatible with the use made in the past.

#2

Dave Reid - June 13, 2009 - 18:14
Assigned to:Anonymous» Dave Reid

To be fair, this is also currently incompatible with 1.x as well. Also to be fair, the hook_xmlsitemap_links also had a significant change in beta 4/5 and is now back to the original implementation so it hasn't had a steady, reliable implementation in that version yet. The hook implementation in 6.x-2.x is the closest way to the 'Drupal way' and in my opinion seems the most likely to not require any changes in the future. Since the 6.x-2.x branch will soon become the recommended branch, we should probably encourage any Drupal 6 modules that want to integrate with XML sitemap to do so with the 6.x-2.x hook implementations. I'm investigating how to get the current gallery_xmlsitemap_links updated and I'll post a patch back here.

#3

kiamlaluno - June 13, 2009 - 19:29
Title:Incompatibility with XML sitemap 2.x» Incompatibility with XML sitemap for Drupal 6

XML sitemap 1.x branch doesn't expect that hook to return a value, which is the exact behavior required from that custom hook in XML sitemap for Drupal 5 (we should say that, if we are really going to be fair).

#4

Dave Reid - June 13, 2009 - 19:37
Title:Incompatibility with XML sitemap for Drupal 6» Incompatibility with XML sitemap 2.x

The gallery implementation of hook_xmlsitemap_links is also incompatible with 6.x-1.x and 5.x-2.x because it returns a full XML generated sitemap page, which is not what is expected either. Basically, it's just plain wrong. :)

#5

Dave Reid - June 13, 2009 - 19:41
Title:Incompatibility with XML sitemap 2.x» Incompatibility with XML sitemap

The incompatability is no longer XML sitemap-specific. :)

#6

kiamlaluno - June 13, 2009 - 20:17
Title:Incompatibility with XML sitemap» Incompatibility with XML sitemap 2.x

It is actually compatible with XML sitemap 5.x-2.x-dev, which executes the following code:

<?php
/**
* Extract links from site maps returned by hook_xmlsitemap_links().
* @return An array of links.
*/
function _xmlsitemap_xml_links() {
 
$links = array();
 
$xml = module_invoke_all('xmlsitemap_links', 'xml');
 
$xml = array_merge($xml, module_invoke_all('gsitemap', 'xml'));
 
// ...
}
?>

That is also the code executed in XML sitemap 6.x-0.x-dev (http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/xmlsitemap/...).

As the future of XML sitemap is its branch 2.x, it is better to change this issue title; differently, the maintainer of this project will not understand why we are talking of incompatibility, when he is sure the code is correct for XML sitemap 6.x-0.x-dev.

#7

AFowle - June 13, 2009 - 20:38

Steady on, you chaps

It wasn't my intention to provoke a flame war. I think this actually reflects a weakness in the Drupal project process. There seems to be reasonable guidance for modules interacting with core, but no mechanism for settling differences in API interpretation between 2 contributed modules.

FWIW, the XML Sitemap project is tricky - it's not well documented, I have only a limited understanding of the concepts (but can see it is useful) and both the v1 and v2 branches change daily. This issue arose because v1 has just stopped working altogether on my sites. Dave Reid's v2 module does say it is not ready for production use but seems to work better than the v1.

I believe I read somewhere that the Gallery module is not being further updated until the position of the external Gallery program is clear with respect to its V3. It would be good to see some public statements on direction soon.

So good luck to both sets of developers with your useful modules and please see if you can help each other ....

#8

Dave Reid - September 7, 2009 - 03:49
Version:6.x-1.0» 6.x-1.x-dev
Status:active» needs review

Maybe we should just remove the gallery_xmlsitemap_links() function from gallery.module until this can be sorted out?

AttachmentSize
490518-gallery-xmlsitemap-D6-1.patch 1.34 KB

#9

Fohsap - October 21, 2009 - 02:24

I believe that implementing gallery 3 into drupal prior to gallery 3's code freeze is the best option. An integrated gallery on a drupal site is every webmaster's wet dream, IMO. The way gallery is embedded into Drupal, now, is kind of despicable. Notice that no matter what theme you use, you get 30 validation errors per page on average, and that if you browse to the gallery's installation outside of drupal, none of the settings are the same.

The problem's onset is well before we even start trying to pitch in 3rd party add-on modules. These two things are not built to work together, presently. Gallery, as it is today, would literally need to literally be altered prior to its embedding in a Drupal site in order for it to sit properly therein.

#10

lvthunder - October 21, 2009 - 02:36

Fohsap you have to have integration support in G3 before you can even begin integration work to the level you want. It's just not there yet and won't be there until G3.1.

 
 

Drupal is a registered trademark of Dries Buytaert.