Posted by dakku on August 3, 2009 at 11:22am
Jump to:
| Project: | Nodewords: D6 Meta Tags |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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:
<?php
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
#1
The code you are reported is not anymore used from the development snapshot.
I am setting this report as fixed.
#2
oh cool. I must be a version out in that case, will cvs update and report back. Thanks you for reply though
#3
Hi,
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..
#4
I set #506982: Views with arguments in path are not detected correctly as duplicate of this one.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.