Hi,

I've upgraded nodewords to 6.x-1.14 from 6.x-1.11 and I've noticed that the revisit-after meta tag is now showing on all pages - before the update it didn't show. We don't want to use this tag but setting the value to blank in the UI doesn't remote it and a look at the code suggests it will always default to 1 day if there's no value set.

  $tags['revisit-after'] = $value > 1 ? "$value days" : '1 day';

<meta name="revisit-after" content="1 day">

Is there a way to disable this tag?

CommentFileSizeAuthor
#5 nodewords-n1889646-5.patch1.45 KBDamienMcKenna
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Title: Any way to disable refresh-after tag? » Remove default from refresh-after tag
Category: support » bug

That's a bug, it shouldn't have a default value like that. Oops, sorry.

serenecloud’s picture

Thanks Damien, good to know I'm not going crazy. Do you have an ETA for a fix or a release target?

serenecloud’s picture

Hey Damien, sorry to keep asking about this but do you know when there will be a patch available? Cheers.

anneeasterling’s picture

This was also an issue for me. My apologies for not submitting an official patch (and yeah, I need to learn how to do that), so here is my "patched" version of /sites/all/modules/patched/nodewords/nodewords_basic/nodewords_basic.module

Replace line 636-651 with the following:

/**
 * PATCHED TO REQUIRE VALUE BEFORE VALIDATION
 * Validate the meta tag value.
 */
function nodewords_basic_revisit_after_form_validate($element, &$form_state) {
  if (!preg_match('/^[0-9]*$/', $element['#value']) && !empty($element['#value'])) {
    form_error($element, t('The meta tag REVISIT-AFTER value must be a positive number.'));
  }
}

/**
 * PATCHED TO REQUIRE VALUE BEFORE SETTING REVISIT-AFTER TAG
 * Set the meta tag content.
 */
function nodewords_basic_revisit_after_prepare(&$tags, $content, $options) {
  if (!empty($content['value'])) {
    $value = ($content['value']);
    $tags['revisit-after'] = $value > 1 ? "$value days" : '1 day';
  }
}

This works on the site that I'm working on now. Improvements are welcome!

Thanks,
Anne

DamienMcKenna’s picture

Version: 6.x-1.14 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
1.45 KB

Try this.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed! Thanks Anne!

Status: Fixed » Closed (fixed)

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