Closed (fixed)
Project:
XML sitemap
Version:
7.x-2.x-dev
Component:
xmlsitemap_node
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 May 2008 at 13:59 UTC
Updated:
11 Jun 2008 at 14:58 UTC
Jump to comment: Most recent file
Comments
Comment #1
Frieder commentedmerlinofchaos from Views says:
Well, the nature of that error looks like XMLSiteMap is incorrectly implementing hook_views_query_alter -- probably using leftovers from the Views 1 stuff. I feel confident this is an XMLSiteMap issue.
Can you fix that?
Comment #2
ehsan.akhgari commentedTrying to get this in my tracker...
Comment #3
jwilde commentedI'm getting the same thing. I tried to fix it but in the end I commented out the code for function xmlsitemap_node_views_query_alter.
jim
Comment #4
wayland76 commentedmerlinofchaos is quite right.
The old code reads:
The documentation for the new views says we should use:
I don't know what's happened to summary and level, but seeing as how we're not using them in our function anyway, they probably don't matter that much. The main questions are things like:
1. Does the $query object still have the same API that it had in Views 1?
2. Do the other views hooks still function?
The views 2 documentation is currently sketchy, and I don't have enough Views expertise to answer these questions.
Comment #5
Frieder commentedI changed the code from:
function xmlsitemap_node_views_query_alter(&$query, &$view, $summary, $level) {
to
function xmlsitemap_node_views_query_alter(&$view, &$query) {
The problem is i am very new to drupal, and I dont understand, why xmlsitemap uses there this hook, and what for? I dont believe that things work now as expected, but at least the errors are gone :)
Comment #6
wayland76 commentedOk, here's a proper patch (identical to Freider's solution). I have to admit, I'm not 100% sure what's going on here either. I'm guessing that between the two views hooks (Frieder: are you familiar with hooks?) to make it so that Views 2 can work with some of the XML Sitemap data. If you go into views, and see either "XML Sitemap: Sitemap" or "XML Sitemap: News", and those features seem to be working proerly, then everything's probably fine. Unfortunately, XML Sitemap seems to be crashing my 6.x site at the moment, so I can't test it :).
Comment #7
Frieder commentedI know hooks from wordpress, I also know some php stuff, but I am completly new to Drupal :)
I made clean fresh install of Drupal with CCK , Views 2 and some other stuff but Xmlsitemap works really fine for me.
Maybe DarrenOh can review this patch :)
Comment #8
wayland76 commentedWell, when the Views module gets to certain points in its code, it calls any function that's called *_views_query_alter. So you can see how the above one works.
We've got one review anyway; if we can get one or two more people to test it, that should cover things a bit.
Comment #9
darren ohFixed in CVS commit 118144.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.