1. Assign a node to a Taxonomy-based Workbench Access section
2. Delete the term
3. View or edit the node

Notice: Trying to get property of non-object in taxonomy_workbench_access_load() (line 193 of sites/all/modules/workbench_access/modules/taxonomy.workbench_access.inc).
Notice: Trying to get property of non-object in taxonomy_workbench_access_load() (line 194 of sites/all/modules/workbench_access/modules/taxonomy.workbench_access.inc).
Notice: Trying to get property of non-object in taxonomy_workbench_access_load() (line 195 of sites/all/modules/workbench_access/modules/taxonomy.workbench_access.inc).

This error might happen with Menu access too, I haven't yet checked.

I think this should fail more gracefully, i.e. it should treat the node's Workbench Access section as "Unassigned" when the section's term no longer exists.

I will see if I can come up with a patch later.

Comments

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new8.25 KB

It also applies to menu because, apparently, we can't have the taxonomy hooks inside the module include files anymore.

This used to work. What version of Drupal are you running?

agentrickard’s picture

Assigned: pjcdawkins » Unassigned
agentrickard’s picture

Better patch, to ensure no orphaned terms are used.

agentrickard’s picture

[edit] The old code was old. Here's what Token is doing now:


/**
 * Implements hook_module_implements_alter().
 *
 * Adds missing token support for core modules.
 */
function token_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'tokens' || $hook == 'token_info') {
    foreach (_token_core_supported_modules() as $module) {
      if (module_exists($module)) {
        $implementations[$module] = TRUE;
      }
    }
    // Move token.module to get included first since it is responsible for
    // other modules.
    unset($implementations['token']);
    $implementations = array_merge(array('token' => 'tokens'), $implementations);
  }
}
agentrickard’s picture

New patch that ensures our files are loaded.

Status: Needs review » Needs work

The last submitted patch, 1356272-workbench-access-hook-refactor.patch, failed testing.

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new9.96 KB

Slightly improved docs.

agentrickard’s picture

Looks good. Waiting for testbot.

Status: Needs review » Needs work

The last submitted patch, 1356272-workbench-access-hook-refactor.patch, failed testing.

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new9.87 KB

Looks like testbot doesn't clear cache / rebuild the stack the same as runtime Drupal.

agentrickard’s picture

Status: Needs review » Fixed

Committing.

Very frustrated that no one ever bothered to review this patch.

Status: Fixed » Closed (fixed)

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