Partially the result of #2653446: Undefined variable after deleting content type, hook_metatag_config_delete() is passed a string but currently expects an object.

/**
 * Implements hook_metatag_config_delete() on behalf of i18n_string.
 */
function i18n_string_metatag_config_delete($config) {
  $context = 'metatag_config:' . $config->instance;
  metatag_translations_delete($config->config, $context);
}

hook_metatag_config_delete() is expecting a $config object but is passed an $instance string.

/**
 * Delete a metatag configuration record.
 */
function metatag_config_delete($instance) {
  db_delete('metatag_config')
    ->condition('instance', $instance)
    ->execute();

  // Allow modules to act upon the record deletion using
  // hook_metatag_config_delete().
  module_invoke_all('metatag_config_delete', $instance);

  // Clear any caches.
  metatag_config_cache_clear();
}

The hook is invoked by metatag_config_delete() which passes the $instance string.

Comments

Devin Carlson created an issue. See original summary.

damienmckenna’s picture

*goes back to bed*

devin carlson’s picture

Status: Active » Needs review
StatusFileSize
new2.43 KB

A patch to pass hook_metatag_config_delete() a $config object.

damienmckenna’s picture

Would you mind putting together a test for this? Thanks.

damienmckenna’s picture

damienmckenna’s picture

StatusFileSize
new6.96 KB

Something like this.

damienmckenna’s picture

Status: Needs review » Fixed

Thanks Devin! Committed.

damienmckenna’s picture

Issue tags: +SprintWeekend2016

Status: Fixed » Closed (fixed)

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