XML Sitemap implements hook_views_query_alter(), but it has a problem.
The code it uses contains the following lines:
switch ($view->page_type) {
case 'xmlsitemap_news':
$query->add_field('created', 'node');
// ...
}
which causes a PHP message error because the property page_type doesn't exist.
What would be the correct property to use in such cases?
Thanks in Advance for any help.
Comments
Comment #1
avpadernoA little more informations; the implementation of the hook is defined:
Comment #2
merlinofchaos commentedThat is Views 1 code, clearly. You might try checking $view->style_plugin but I fear that there is a larger problem here: The general flow of a view is very different now, and using query alter is unnecessary as style plugins in Views 2 have a query() method that they can use to directly modify the query themselves. The style plugin being used there needs to be rewritten.
You can probably just comment out this code for now.
Comment #3
avpadernoThanks for your help.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.