Closed (fixed)
Project:
Workflow
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Apr 2012 at 03:58 UTC
Updated:
18 Jul 2013 at 21:51 UTC
Jump to comment: Most recent file
Comments
Comment #1
julienjoye commentedHi !
Same issue here.
I solved that problem by replacing in workflow.module this line (l.589) :
if (isset($form['#node'])) {By this one :
if ($form_id == $form['#node']->type . '_node_form') {Btw I replaced the comment line (l.599) :
// Abort if user does not want to display workflow form on node editing form.By that :
// Abort if user does not want to display workflow form on comment form.Regards.
Comment #2
julienjoye commentedComment #3
Vidus commentedThanks! Good to know I wasn't the only one having the issue. And DOUBLE thanks for the fix.
Comment #5
drbartje commentedI am by no means a PHP expert but I think (regardless of this issue) the first 'if' in 'workflow_form_alter' that now reads:
should be re-written to something like:
The second 'if' is superfluous as the first one already checked if $form['#node'] is set (and therefore the 'else' part will never be triggered.
I don't think the solution proposed above is the right one. I've changed my installation as follows:
Comment #6
drbartje commentedLooking at the definition of variable_get I think
if ($isnode && (!in_array('node', variable_get('workflow_' . $form['#node']->type, array('node'))))) {may just need to be
if ($isnode && (!in_array('node', variable_get('workflow_' . $form['#node']->type)))) {as I am not sure why you would provide a default value in this case.
Comment #7
ttkaminski commented@DrBartje - I think you've got the right idea and I'm pretty sure your code works. I've rewritten it, and attached it as a patch. In my version, I removed
isset($form['#node']->type)since if the node object exists, then it should have a type. If it doesn't then it's a bug somewhere else. My version also removes duplicate/redundant code, so as it make it more maintainable.Comment #8
Frederic wbase commentedI've tested the patch from ttkaminski and it seems to work just fine!
Thanks for your work!
grts
fre
Comment #9
spgd01 commentedtested patch and it works so far
Comment #10
haggan commentedWorks good for me also!
Comment #11
pumpkinkid commentedWorks here as well!
Comment #12
gkom commentedWorking well here too! Thank you
Comment #13
akalata commented#7 RTBC?
Comment #14
nancydruIs this still a problem in the current -dev release? Workflows are no longer tied to the comment form.
Comment #15
nancydruIf someone checks back in and finds this still an issue, reopen it.
Comment #16
justanothermark commentedI was also having this problem in the latest dev version for D7 and have attached a patch to fix it.
The attached patch is simpler than the one in #7 so is less likely to affect other behaviour. It should also apply cleanly to latest dev version as the patch in #7 is now outdated due to other changes.
Comment #17
justanothermark commentedSame patch as #16 with unnecessary assignment removed.
Comment #18
nancydruMark, why is the terminal state check being deleted?
Comment #19
justanothermark commentedI'm not sure what you mean by 'terminal state check' but in the original code the if & the else were doing the same thing:
Load node is now done in the shorthand if just in case the node isn't in $form['#node'] (although I'm not sure when it wouldn't be).
Loading the variable was the same but was getting type from different places because of how the $node was loaded so these lines are now the same with a consistent $node before.
Checking for node/comment in the variable can be simplified because $form['#entity_type'] is already set to node/comment for us.
Comment #20
nancydruThere was a check to see if any states were available and skipping the form if not. That was to check if the node was at the last, or terminal, state.
Comment #21
justanothermark commentedDo you mean this bit of code:
This patch doesn't do anything with that code so it should still be there after the patch is applied.
Comment #22
nancydruCommitted with attribution. Thanks for the patch.