Hello

First of thanks for creating this module! I am using it for the first them in a drupal 7.4.

When creating a new node and changing the state to Needs Review i get the following errors

Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 423 of /.../sites/all/modules/contrib/workbench_moderation/workbench_moderation.module).

Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 423 of /.../staging_pom/sites/all/modules/contrib/workbench_moderation/workbench_moderation.module).

Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 425 of /.../sites/all/modules/contrib/workbench_moderation/workbench_moderation.module).

Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 425 of /.../sites/all/modules/contrib/workbench_moderation/workbench_moderation.module).

Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /.../modules/node/node.module)

For the rest everything seems to work like i should be...

grts

frederic

Comments

stevector’s picture

I am not able to reproduce this error. Do you get it every time you create a node? Do you get this error when logged in as user 1 or only a certain kind of user?

dave reid’s picture

Status: Active » Postponed (maintainer needs more info)
MJR113’s picture

I get the same error messages - it doesn't matter which user is logged in or the type of node. I started getting this problem after updating to Workbench Moderation 7.x-1.0-beta8 and upgrading Revisioning to 7.x-1.2.

Frederic wbase’s picture

with user 1 i don't have the problem

grts

frederic

dstacey’s picture

I tried 3 different users with varying roles, get the errors below.
Obviously when I disable "Enable moderation of revisions" (in content-type: publish options) the errors go away but then I'm missing all the fun stuff.
I'm on tag "7.x-1.2" of revisioning,
"7.x-1.0-beta8" of workbench_moderation,
"7.x-1.0-beta6" of workbench

Thanks,
Dave
-----------
# Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 425 of /var/www/d7/sites/all/modules/workbench_moderation/workbench_moderation.module).
# Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 425 of /var/www/d7/sites/all/modules/workbench_moderation/workbench_moderation.module).

MJR113’s picture

I was able to fix this issue by disabling the Revisioning module and then clearing the cache.

brad80’s picture

Version: 7.x-1.0-beta8 » 7.x-1.1

I'm seeing a similar error with all users anytime I access the moderation tab for content. I tried MJR113's tip with out success. Here's the full error that I received:

Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 431 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 431 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 433 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 433 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 434 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 434 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1828 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1829 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1829 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1836 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1840 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /swadm/Websites/drupal/modules/node/node.module).
Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 431 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 431 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 433 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 433 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 434 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 434 of /swadm/Websites/drupal/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /swadm/Websites/drupal/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /swadm/Websites/drupal/modules/node/node.module).

stevector’s picture

brad80, are you also using Revisioning module?

clare-ux’s picture

I get the same error using the Revisioning 7.x-1.2 and Workbench 7.x-1.1 :(

webfeathers’s picture

I, also, am getting the same errors with these.
Same version of Revisioning (7.x-1.2) and WorkBench (7.x-1.1)

Disabling revisioning does indeed get rid of the error... of course it also gets rid of revisioning :)

anschinsan’s picture

Category: bug » task
Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs work

Problem/Motivation

This issue is still a problem in the dev version

Proposed resolution

Add 'access argements' in function workbench_moderation_menu_alter, as you overwrite the access callback without giving the arguments.

Code should look like this:

<?php

  // For revert and delete operations, use our own access check.
  $items['node/%node/revisions/%/revert']['access callback'] = '_workbench_moderation_revision_access';
  $items['node/%node/revisions/%/delete']['access callback'] = '_workbench_moderation_revision_access';
  $items['node/%node/revisions/%/revert']['access arguments'] =  array(1, 2);
  $items['node/%node/revisions/%/delete']['access arguments'] =  array(1, 2); 

?>

I've set the priority to major, as this is only a small thing to do but the long list of errors thrown by this bug prevents the module from being used in production together with the revisioning module.

Thanks for your work!

Anonymous’s picture

I'm getting similar errors (using the dev version), but it has different line numbers, and more total lines of errors. Here it is....

Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1828 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1829 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1829 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1836 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1840 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /home/cfaadev/public_html/modules/node/node.module).
Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /home/cfaadev/public_html/modules/node/node.module).
Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /home/cfaadev/public_html/modules/node/node.module).
Warning: Missing argument 1 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Warning: Missing argument 2 for _workbench_moderation_revision_access() in _workbench_moderation_revision_access() (line 498 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _workbench_moderation_revision_access() (line 500 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: node in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Undefined variable: op in _workbench_moderation_revision_access() (line 501 of /home/cfaadev/public_html/sites/all/modules/workbench_moderation/workbench_moderation.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1819 of /home/cfaadev/public_html/modules/node/node.module).
Notice: Trying to get property of non-object in _node_revision_access() (line 1848 of /home/cfaadev/public_html/modules/node/node.module).

Any ideas of a fix as I need certain users to have access to this area for moderation....

dustin@pi’s picture

This is a patch with the change that @anschinsan proposed in #11.

cangeceiro’s picture

Status: Needs work » Needs review

I am also experiencing this issue and the patch in #13 resolved.

ajinkya.kulkarni’s picture

Yes. Patch in #13 fixed the issue.

technotim2010’s picture

I can confirm the fix #13 with version 7.x.1.2 and Revisioning 7.x.1.4 works properly. You need to clear caches after applying. Thanks for excellent work.

aimeerae’s picture

I can also confirm the fix #13 works with d 7.22, workbench moderation 7.x-1.3, revisioning 7.x-1.4 works properly. Caches cleared, all is well. Thank you for the patch, it cleared the angry redness from the page!

katannshaw’s picture

Patch #13 and clearing the cache fixed this issue for me as well. My setup: Drupal 7.22, Workbench Moderation 7.x-1.3, Revisioning 7.x-1.5. Thanks!

bbc’s picture

#13 and cc all did the trick for me as well. Drupal 7.23, Workbench Moderation 7.x-1.3 and Revisioning 7.x-1.5. Would be great to see this one committed.

xurizaemon’s picture

Status: Needs review » Reviewed & tested by the community

RTBC. Tested here, and by several others above.

dustin@pi’s picture

FYI, I have been running a production site based on the patch in #13 (the one I added based on the change that @anschinsan suggested in #11) since last fall across multiple versions of Revisioning, Workbench Moderation and Drupal.

bbc’s picture

I had been using the patch from #13 in production for a couple months, but ran into some issues recently that relate to Incompatible with Revisioning module (https://drupal.org/node/1894194). After much head-scratching, reverting the changes from that patch and disabling Revisioning was the only fix I could find. With the exception of Revisioning Scheduler, I haven't tripped over any loss in features/functionality so far.

larowlan’s picture

+++ b/workbench_moderation.module
@@ -194,6 +194,8 @@ function workbench_moderation_menu_alter(&$items) {
+  $items['node/%node/revisions/%/delete']['access arguments'] =  array(1, 2); ¶

Whitespace error

larowlan’s picture

StatusFileSize
new810 bytes

Fixes #23

larowlan’s picture

In fact, that's not right either, as $node->workbench_moderation['current'] isn't correctly loaded. You also need load arguments to get the two to work together.

Anonymous’s picture

I run into the same issue when also having the revisioning module installed (https://drupal.org/project/revisioning). Disabling it solves the problem. It seems they have some conflicting menu links and/or node access hooks.

colan’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

In fact, that's not right either, [...]

So is this really RTBC?