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

apaderno’s picture

Status: Active » Fixed

The code you are reported is not anymore used from the development snapshot.

I am setting this report as fixed.

dakku’s picture

oh cool. I must be a version out in that case, will cvs update and report back. Thanks you for reply though

dakku’s picture

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..

apaderno’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.