Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Currently, workflow_node_view()
injects
- the workflow state (
workflow_current_state
element) in allfull
node views - the workflow form (
workflow
element) in allfull
node views if user has permission to perform at least one state change
These data can be hidden in theme or removed in a hook_node_view_alter()
implementation, but they should probably not be always exposed:
workflow_current_state
should probably be controlled by a#access
check, so that only roles allowed to see this information see itworkflow
does not look like it needs a permission, since its internal behaviour is already controlled by workflow state access rules, however, it should probably be configurable, because it makes for heavy UI and not all sites will want it to be present both on the main page and the workflow tab. I think a configuration variable would be better
If you agree with either (or both) of these, I can roll a patch.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1893724a.patch | 3.56 KB | NancyDru |
#5 | 1893724.patch | 3.09 KB | NancyDru |
Comments
Comment #1
NancyDruPlease do roll a patch.
Comment #2
NancyDruHow does this look?
Comment #3
NancyDruSee also #1893542: How to not show the workflow transition form in node view page.
Comment #4
NancyDru#1893200: Undefined offset: 0 in workflow_node_view() (line 510 marked as duplicate.
Comment #5
NancyDruHere's a patch
Comment #6
NancyDruThis one adds a permission so that even with state change rights, the form can be suppressed from the node view.
Comment #7
adamtong CreditAttribution: adamtong commentedThis problem in #4 marked as duplicate but I try the patches at #6 didn't solve the error message of the following:
Notice: Undefined offset: 0 in workflow_node_view() (line 510 of /home/mallbar/www/demo13/sites/all/modules/workflow/workflow.module).
Notice: Trying to get property of non-object in workflow_node_view() (line 519 of /home/mallbar/www/demo13/sites/all/modules/workflow/workflow.module).
Notice: Undefined offset: 0 in workflow_tab_form() (line 127 of /home/mallbar/www/demo13/sites/all/modules/workflow/workflow.pages.inc).
Comment #8
NancyDruHmm... I assume you've cleared the caches, even though that shouldn't matter.
Comment #9
NancyDru@adamtong: At line 843, you should see:
Please reverse those two lines
Let me know, please.
Comment #10
NancyDruCommitted to -dev.