Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I just came across this really weird issue where a view is identified incorrectly vy the _nodewords_detect_type_and_ids() function: here is my setup
2 Page Views with following paths:
-- /blog (view id 1)
-- /blog/term/% (view id 2)
When I view the "/blog/term/xx" page view, the IDS (id:1) is incorrectly returned, this belongs to the "blog" view. The IDS should be 2 and not 1..
I dug a bit further in the _nodewords_detect_type_and_ids() function and found:
if (module_exists('views')) {
$result = db_query("SELECT vid, display_options FROM {views_display} WHERE display_plugin = '%s'", 'page');
while ($view = db_fetch_object($result)) {
$display_options = unserialize($view->display_options);
$pos = strpos($_GET['q'], $display_options['path']);
if ($pos === 0) {
return array('type' => 'views', 'ids' => array($view->vid));
}
}
}
It seems strpos may not be the best way to handle and resolve wildcard paths.. any ideas??
Cheers
Comments
Comment #1
apadernoThe code you are reported is not anymore used from the development snapshot.
I am setting this report as fixed.
Comment #2
dakku CreditAttribution: dakku commentedoh cool. I must be a version out in that case, will cvs update and report back. Thanks you for reply though
Comment #3
dakku CreditAttribution: dakku commentedHi,
It works. I like the new method of dealing with views ;p
I have written a quick tutorial on how to add custom/dynamic meta tags based on the arguments that might be getting passed into the view..
http://janaksingh.com/blog/adding-meta-tags-taxonomyterm-override-view-p...
If you find any bugs or an alternative workaround, please leave me a comment..
Comment #4
apadernoI set #506982: Views with arguments in path are not detected correctly as duplicate of this one.