With the Seven theme (used when admins wdit user profiles) I get this message when the module tries to remove local tasks from the user edit page:

Fatal error: Cannot unset string offsets in /home/mfhweb/cc.mfhweb.co.uk/themes/seven/template.php on line 32

I know it's something to do with this module because this doens't happen with users who don't use the admin overlay and Seven theme when editing user profiles.

Any help?
Thanks

Comments

ebeyrent’s picture

Sounds like this should really be posted against core - template.php is expecting local tabs to be there?

ebeyrent’s picture

Project: Context Hide Local Tasks » Drupal core
Version: 7.x-1.0-alpha1 » 7.x-dev
Component: Code » Seven theme
/**
 * Override or insert variables into the page template.
 */
function seven_preprocess_page(&$vars) {
  $vars['primary_local_tasks'] = $vars['tabs'];
  unset($vars['primary_local_tasks']['#secondary']);
  $vars['secondary_local_tasks'] = array(
    '#theme' => 'menu_local_tasks',
    '#secondary' => $vars['tabs']['#secondary'],
  );
}

Looks like there needs to be a check to see if the keys exist in $vars before unsetting.

metakel’s picture

Project: Drupal core » Context Hide Local Tasks
Version: 7.x-dev » 7.x-1.x-dev
Component: Seven theme » Code

I can confirm that it should be caused by the project "Context Local Tasks".

Even if I change the administrative theme to other theme (other then "Seven"), I still get the similar Fatal error.

e.g. When using Seven as admin theme, it is template.php line 32
When using Adminimal_theme, it is template.php line 43

Both of these lines contain similar statement:

unset($vars['primary_local_tasks']['#secondary']);

Once disabled the Context Local Tasks module, the error is gone.

Valdars’s picture

My solution was to change line 22 in plugins/context_reaction_hide_local_tasks.inc to
$vars['tabs'] = array('#primary' => array(), '#secondary' => array());