has no results. I don't get a dialog for adding a custom page. I'm trying to inject meta tags in to my Views generated page (which is the home page of the site).
What am I doing wrong ?

Comments

rjbrown99’s picture

Component: Third-party modules integration » Code
Category: support » bug

There's a bug. I suspect I know WHERE it is, but not why yet.

In nodewords_custom_pages.admin.inc, inside of nodewords_custom_pages_edit(), there's this bit of code:

  $nodewords_form = nodewords_tags_edit_fields(
    array('type' => NODEWORDS_TYPE_PAGE, 'id' => isset($page->pid) ? $page->pid : 0),
    $page->tags,
    array(
      'fieldset' => FALSE,
      'admin' => TRUE,
    )
  );

  if (empty($nodewords_form)) {
   return $form;
  }

The $nodewords_form is coming back empty, so we are kicked out of the nodewords_custom_pages_edit with nothing else. Not sure why yet but that's at least a lead on fixing it.

rjbrown99’s picture

A bit more information. This is actually failing in nodewords.module(), specifically the function nodewords_tags_edit_fields. Here's the relevant lines of code:

      if ($bool || ($filter_metatags && empty($edit_tags[$name]))) {
        continue;
      }

In my case, $bool does not exist, $filter_metatags is set to '1' by the global NODEWORDS_TYPE_DEFAULT, and $edit_tags[$name] were all set to zero.

Working on this a bit more, I found out how to resolve the issue based on what sets $edit_tags[$name]. On the main nodewords admin page (admin/content/nodewords), under the section "Meta tags enabled on administrative settings pages", make sure you check the box for Show in Edit Form. If that box is not checked, the add button pretty much does nothing and you wind up failing at that if statement.

I imagine this is how the developers intended it to be, however it would be nice to have an error that says "Hi sorry you don't have anything enabled on the other page." That would have saved me a bunch of time. Thanks.

Anonymous’s picture

Category: bug » support
Status: Active » Fixed

If you don't see any form to edit the meta tags is because:

  • You didn't enable any module implementing meta tags; in this case, you should get an error message from Drupal.
  • You didn't select which meta tags can be edited.

Status: Fixed » Closed (fixed)
Issue tags: -views nodewords

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