OK so to explain my situation first:

1. After upgrading and realizing there were some extra steps to take I got the new nodewords all working.
2. Then found the nodewords by path no longer worked - uninstalled the module to remove all links.
3. Started to create my new meta by paths through the "Other Pages" under the global settings.

So theoretically everything is set, however none of these pages are showing the correct meta tags only the default ones. I would have thought the other pages trump the default? Or this was the case with nodewords by path.

Any advice would be great thanks.

Comments

javierpavon2000’s picture

I have the same problem!

javierpavon2000’s picture

i solved this problem, in the file modules/nodewords/basic_metatags/basic_metatags.metatags.inc, change the function basic_metatags_description_prepare for this:

function basic_metatags_description_prepare(&$tags, $content, $options) {

 if (empty($content['value']) && count($options['ids']) == 1) {
    switch ($options['type']) {
      case 'term':
        $term = nodewords_get_term($options['ids'][0]);
        if ($term) {
          $content['value'] = $term->description;
        }
        break;

      case 'vocabulary':
        // TODO: probably we have to do a db_rewrite_sql() query here so access is restricted
        $voc = taxonomy_vocabulary_load($options['ids'][0]);
        if ($voc) {
          $content['value'] = $voc->description;
        }
        break;

        case 'node':
                $value = nodewords_load_tags('page','node/'.$options['ids'][0]);
                $content['value'] = $value['description']['value'];
        break;
    }

  }

  $tags['description'] = empty($content['value']) ? (!empty($options['default']['description']['value']) ? $options['default']['description']['value'] : '') : $content['value'];
}

and change the function basic_metatags_keywords_prepare

function basic_metatags_keywords_prepare(&$tags, $content, $options) {
  if (empty($content['value'])) {
    $content['value'] = (!empty($options['default']['keywords']['value']) ? $options['default']['keywords']['value'] : '');
  }

  if ($options['type'] == 'node' && module_exists('taxonomy') && count($options['ids']) == 1) {
    error_log("en prepare keyword");
        $node = node_load($options['ids'][0]);
        if (count(taxonomy_node_get_terms($node) == 0)){
                $value = nodewords_load_tags('page','node/'.$options['ids'][0]);
                $content['value'] = $value['keywords']['value'];
                error_log(print_r($value,true));
        }else{
                foreach (taxonomy_node_get_terms($node) as $term) {
                        error_log($term);
                        if (in_array($term->vid, variable_get('nodewords_keyword_vids', array()))) {
                                if (empty($content['value'])) {
                                        $content['value'] = $term->name;
                                } else {
                                        $content['value'] .= ',' . $term->name;
                                }
                        }
                }
        }
  } elseif ($options['type'] == 'term') {
    $terms = array();

    foreach ($options['ids'] as $id) {
      $term = taxonomy_get_term($id);
      if ($term) {
        $terms[] = $term->name;
      }
    }

    if (count($terms)) {
      $content['value'] = implode(',', $terms);
    }
  }

  $tags['keywords'] = nodewords_unique($content['value']);
}

with this, the module works

glynster’s picture

hey javierpavon2000,

I have followed your steps by replacing the code int he module with you updates but what happens for me is the description stays on the default and the keywords are not printed at all.

Any ideas?

Also adding this code threw me a white screen when I tried to delete a Drupal Path Meta Tag.

glynster’s picture

Wow OK so no help from the maintainers here and it would seem no-one else is having this issue?
Again this was a simple update and I have no idea why it is not working?
Thanks for the help javierpavon2000 but the module should be working without this fix, asside from it not working for me.

rhouse’s picture

Same problem here. No keyword metatag. I also tried javierpavon2000's changes, but no dice. I thought this was the primary purpose of this module. Did no one test it before releasing it and saying it was a critical security update?

I do appreciate the hard work that's gone in here, but this sort of foul-up really causes chaos.

And BTW, what are the 'extra steps' needed to make the thing do what it was doing just fine previously?

avpaderno’s picture

Priority: Critical » Normal

Wow OK so no help from the maintainers here

The issue report is open from just a day. Then, the code has been already changed in the development snapshot, and the issue reported here could be already resolved.

avpaderno’s picture

        case 'node':
                $value = nodewords_load_tags('page','node/'.$options['ids'][0]);
                $content['value'] = $value['description']['value'];

Basically, you are loading from the database a value that is already passed to the function. To notice that the meta tags for a node are saved using node as type, not page.

avpaderno’s picture

Version: 6.x-1.2 » 6.x-1.x-dev
glynster’s picture

OK so I took on what KiamLaLuno said and installed the dev version as much as a prefer not too and sad to say the following happened:

1. Installed and then ran update.php
2. Ran my Drupal Cache just incase
3. Looked at the heads for the meta tags and all I see now is a letter for each tag???
4. My default meta has been changed to a letter in each section.
5. All my Other Pages have been wiped and replaced with one letter in each section??? It is the first letter of each section left after save.
6. I said OK no problems it should work now.
7. No matter how many times I enter in my tags the save is just not working so right now all I have is one letter tags.

Again any help would be very much appreciated.
The all started because I saw a system update for the module and it really does appear that even the dev version is not working as expected.

I also performed a complete uninstall of the module to start from a fresh start and still the same result.

avpaderno’s picture

Priority: Normal » Critical

I don't have this problem; I see all the content of the meta tags, not just the first letter.

glynster’s picture

I upgraded to the dev version and this one letter thing started to happen.
I am running Drupal 6.14
I am also running the latest version of nodewords 6.1.x
On every save in the Global Settings I get one letter save per line.
The previous stable release was not doing this.

glynster’s picture

OK as of right now I think it is safe to say that if you want to update a set global meta tags and you follow the steps to install the new version of 6.1.2 all should be fine. If you need meta tags set per path then neither the current stable version or the latest dev are working correctly. So I will revert back to my setup as before which is using 2 modules "nodewords" and "nodewords by path" then on future releases I will run some tests to make sure they are working as expected.

I hope this helps others who have been having issues.

glynster’s picture

OK I can confirm the latest dev version 6.1.X date of the 28th September now does actually print the meta tags in the head. No more first letters and no printing at all. So it would appear this problem has been resolved.

avpaderno’s picture

Status: Active » Fixed

I am marking this report as fixed as per previous comment.

Status: Fixed » Closed (fixed)

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