When creating or editing a node the following errors occur:

  1. When in the node edit form the following warning message appears across the top of the page: "Notice: Undefined index: title in _seo_ui_alter_metatags() (line 213 of sites\all\modules\seo_ui\seo_ui.module)."
  2. On then saving then node, there is a fatal error with a number of error messages.

Steps to reproduce:

  1. Install clean version of drupal 7 (any version)
  2. Install SEO UI ver 7.x-1.0
  3. Install metag module (7.x-1.1 or higher)
  4. Add a new node (basic page or article, it doesn't matter). At this stage the warning message "Notice: Undefined index: title in _seo_ui_alter_metatags() (line 213 of sites\all\modules\seo_ui\seo_ui.module)." appears at the top of the page.
  5. Enter some content and try and save the node. At this stage a fatal error occurs.

Observations:
I've had a quick look at both modules and it looks like the latest version of the metatag module has introduced the 'language code' element into the structure of the metatags form array, thus causing a mismatch with the seo-ui code.
My initial thoughts are the seo-ui.module code needs to be updated to take account of the new metatags array structure.

Workaround:
I found everything worked ok if I fell back to metatag version 7.x-1.0-rc2

Comments

Christopher Riley’s picture

Having the same issue

edrupal’s picture

Issue summary: View changes
edrupal’s picture

Issue summary: View changes
wranvaud’s picture

I just got these errors as well in case it helps debugging (also caused me a fatal error and work lost)

Recoverable fatal error: Argument 2 passed to metatag_filter_values_from_defaults() must be of the type array, null given, called in /var/www/html/dev/net/sites/all/modules/seo_ui/seo_ui.module on line 246 and defined in metatag_filter_values_from_defaults() (line 1901 of /var/www/html/dev/net/sites/all/modules/metatag/metatag.module).

Notice: Undefined index: #metatag_defaults in _seo_ui_alter_metatags_submit() (line 242 of /var/www/html/dev/net/sites/all/modules/seo_ui/seo_ui.module)

Notice: Undefined index: token_group in _seo_ui_alter_metatags() (line 186 of /var/www/net/sites/all/modules/seo_ui/seo_ui.module).
Notice: Undefined index: title in _seo_ui_alter_metatags() (line 210 of /var/www/net/sites/all/modules/seo_ui/seo_ui.module).
Notice: Undefined index: value in _seo_ui_fix_metatag_descriptions() (line 232 of /var/www/net/sites/all/modules/seo_ui/seo_ui.module).
uzlov’s picture

StatusFileSize
new1.75 KB

fixed bug (only for seo_ui)
in new versions of metatag we have language

desix75’s picture

Patch #5 it works for me, (drupal-7.32, metatag-7.x-1.4 seo-ui-7.x-1.0, multilanguage site)

rich.3po’s picture

StatusFileSize
new2.11 KB

Hi - i'm using version Metatag 7.x-1.4 and still get the error:

Notice: Undefined index: value in _seo_ui_fix_metatag_descriptions() (line 227 ...

I've made a small amendment to the patch to fix this

andypost’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Needs review

When there's patch mark issue - needs review

naveenvalecha’s picture

Title: Undefined index title, and fatal error when combined with Metatag 7.x-1.1 » Undefined index title, and fatal error when combined with Metatag 7.x-1.17

updating title.
I'm getting this issue with 7.x-1.17
Notice: Undefined index: title in _seo_ui_alter_metatags() (line 213 of ../docroot/sites/all/modules/contrib/seo_ui/seo_ui.module).

After applying the patch above. The issue at node/add/ page got solved but it was showing the error in _seo_ui_alter_metatags_submit
Working on its fix

naveenvalecha’s picture

StatusFileSize
new3.74 KB
new2.63 KB

Here's teh patch that fixed my issue in #9

nileshlohar’s picture

StatusFileSize
new4.32 KB

Patch in #10 was giving following error while adding translations to the node.

Recoverable fatal error: Argument 2 passed to metatag_filter_values_from_defaults() must be of the type array, null given, called in seo_ui.module on line 249

So, here is the updated patch.

skaught’s picture

Status: Needs review » Reviewed & tested by the community

#11 seems good

vnivuahc’s picture

StatusFileSize
new1.89 KB

I still have an issue when I create a new translated node (using field translations).
The HTML Page Title Settings field group is empty.

$form_state['node']->language returns und, so these lines doesn't work :

        // Traverse the metatags form array and alter the descriptions
        // to link back to metatags module default settings.
        _seo_ui_fix_metatag_descriptions($form['metatags'][$form_state['node']->language], $link);
// [...]
      // Assign the metatags title to our new metatags_title fieldset
      $form['seo_vtab']['metatags_title']['title'] = $form['metatags'][$form_state['node']->language]['basic']['title'];

      // Unset the metatags form title from it's original location
      unset($form['seo_vtab']['metatags'][$form_state['node']->language]['basic']['title']);

I guess it would be better to use something like that :

        $lang = $form['metatags']['#language'];
        _seo_ui_fix_metatag_descriptions($form['metatags'][$lang], $link);

Tested with Metatags v1.25

stborchert’s picture

Priority: Major » Normal
Status: Reviewed & tested by the community » Needs review
StatusFileSize
new4.17 KB

Updated the patch for the latest development version.
Priority downgrade, since its only a notice ;)