Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hi
please can somebody help?
On a simple workflow(Workbench acces is enable with WM), just after publishing the a node it is no more visible in blocks "All Recent Content" and "My Edit"
But when i set Node permission to "Bypass access control" they are back... please any help on what i am doing wrong ?
Comments
Comment #2
agentrickardThat suggests that another module is denying access to the content. That would typically happen if you have a Node Access module installed. In Drupal 7, common modules for this feature are OG, Groups, Content Access, Taxonomy Access Control. There are several more.
If you can, try using the Devel Node Access module (part of the Devel project) to examine the permissions on the "missing" nodes.
If you can't do that, try to take a look at the database table {node_access}. If there are multiple rows in that table, it would help to know what they are.
Comment #3
delacosta456 CreditAttribution: delacosta456 commentedhi agentrickard thansk for replying
Well i can really explain what happen but just after installing this module Workbench Moderation State Permission , i did a drush php-eval 'node_access_rebuild();' and drush rr and everything looks to be normal now as i can see the nodes now.
however another confusion i am in is how to make content follow separate workflow..
What i really mean is : NEW content Workflow and Edition content Workflow
- For A new content will have a logical workflow until revision is publish :
~~~ Draft (Creator)->Needs review(New content Reviewer)->Signature(Master Reviewer)->Publish
- For An existing content , editing it by creating a new draft that will follow another workflow of:
~~~~ Draft(EDITOR) --> need review -->(Edition REVIEWER) ->Publish
Thanks
Comment #4
agentrickardSo running that node access rebuild confirms what I thought. That's great.
For the other request, each transition has a permission to it, so you likely want to restrict certain transitions to certain roles. However, there is no concept of "different workflow states based on the NEW status of the content" as you describe.
Comment #5
delacosta456 CreditAttribution: delacosta456 commentedhi @agentrickard
Restrict certain transitions to certain roles may be a workaround but for a user that has both permissions
the control can not FOR EXAMPLE assure that the user will not do a mistake or intentionally set the state to Draft(EDITOR) for A FRESH because both state will be display to him if he has both permission (if i am not wrong)
Reading a lot of posted issue , truly i have noticed that :
However i am just looking for a way to force a "Already published content's" Next "Default Status" to strictly follow transitions after Published (and not display states that have be followed during first publishing workflow)
Comment #6
agentrickardI didn't realize it until looking, but you could probably handle that in custom code by using
hook_workbench_moderation_states_next_alter()
documented in the api file.In that case you would give all users access to the necessary transition permissions, but remove certain options under some conditions.
Comment #7
delacosta456 CreditAttribution: delacosta456 commentedhi @agentrickard
Thanks i was thinking something like that to but not very confortable with code was confuse on were to start from
however if i understand what you are saying (as i have, at least one time in the past, use a hook_form_alter in a module ) this mean
hook_workbench_moderation_states_next_alter()
i can test the form state and unset[] option..if i am on the right logic please can you help me by giving me direction in the
code below
of my past's custom module by rewriting it with
hook_workbench_moderation_states_next_alter()
by supposing that :-- in WB states are in the order
1.Draft of New content
2.Need review for new content
3Master Validation for for new content
4.Published
5.Draft for Existing content
6.Need review for Existing content
7.Master Validation for Existing content
So transitions available for New content will be only 1-->2-->3-->4 (according to permissions)
And when making a new draft of published content , the custom code , will unset 1, 2, 3 option and make 5, 6 7 available with 5 now being the new initial state.
old module code below
thanks
Comment #8
agentrickardYour statements about
hook_workbench_moderation_states_next_alter()
are correct. However, thehook_form_alter()
code that you posted is not related to Workbench Moderation.The code you need is something like this:
You will need to change the machine_name keys in the code above, since I don't know what they are.
Comment #9
delacosta456 CreditAttribution: delacosta456 commentedhi @agentrickard
Many thanks this was exactly what i was looking for.
the hook_form_alter() i posted , i knew wasn't related to workbench moderation ,,, it was just an old form alter code which i was suggesting you to help me modify to achieve what i was looking for about WM.But it doesn't mean anymore now as you have send me a better and shorten code.
Many thanks
Comment #10
agentrickardHappy to help. Best of luck.