When configuring a workflow, you can choose to add the workflow state change form to both the node edit form and the comment form. Unfortunately, with this patch #1884630: State update conflicts with Comment form, the comment form functionality was broken for comments.
This is the part of the patch that made the change:
function workflow_form_alter(&$form, &$form_state, $form_id) {
// Ignore all forms except comment forms and node editing forms.
- if ((isset($form['#node']) && $form_id == 'comment_node_' . $form['#node']->type . '_form')
- || (isset($form['#node']->type) && isset($form['#node']) && $form['#node']->type . '_node_form' == $form_id)) {
+ if (/*(isset($form['#node']) && $form_id == 'comment_node_' . $form['#node']->type . '_form')
+ ||*/ (isset($form['#node']->type) && isset($form['#node']) && $form['#node']->type . '_node_form' == $form_id)) {
As you can see, the part of the if statement that detects whether or not we are on a comment form has been commented out. The commented-out code was later removed from the code base for the 7.x-1.1 release.
This is an integral part of our site's functionality, since we are using this as part of a trouble ticket system and nobody can change the state of their ticket when adding a comment! In other words, part of the functionality of this module has been broken.
I'm not sure as to what the first patch was trying to change, so I'm not sure about what to do to fix this. I'll keep digging, but I only have limited time to devote to this job before resorting to reverting to a previous version.
Comments
Comment #1
nancydruCertainly this would be easy enough to put back in. However, IMO, this was broken in that one could not submit a comment without a workflow change, or to change the workflow state without adding a comment (which can be done better with a workflow comment instead).
From your comment above, it would seem that you should agree. You can leave a comment without changing the workflow.
Comment #2
coreyp_1 commentedI think I was a bit ambiguous in my previous statement, so I'll try to explain.
Before, people could leave a comment and either change the state or leave it unchanged. In our system, we did not have a use case for someone to change the state without leaving a comment, so I cannot verify whether or not that worked.
As it is now, the state options no longer appears on the comment form. People can leave a comment, and if they know and have permission to access the workflow tab they can change the state, but it is non-intuitive and cumbersome for non-technical users. FWIW, I do understand your argument that a workflow is associated with the node, not the comment, but in this case the comment is the appropriate place for the options to appear, much like the issue queue here on D.org.
We cannot migrate away from the comment system, because comments are entities which means that we can attach additional fields to the comments so that specific information may be provided/requested when changing the workflow state, something that is not easily accomplished otherwise.
We truly need this functionality restored. If this caused problems in other areas then of course those bugs need to be fixed, but it is not good to remove existing functionality (which is still alluded to in the
admin/config/workflow/workflowpage).I'm sorry if I come across as complaining. It's definitely not intended as such!
Comment #3
nancydruI agree that it is mentioned in the admin page and, in that light, needs to work. I may have had my site set up more complicated than yours and restoring the if() statement made a mess. But I would like you to try it and see if that's all it takes to solve this.
Comment #4
nancydruCommitted
Comment #6
marcor commentedThe patch is not working: Instead of the comment workflow form, the form of the node the comment belongs to is displayed. Each comment workflow status change also changes the node's workflow state.
In the case I noticed this, both node type and its comment were activated for the same workflow, obviously.
Comment #7
marcor commentedI just checked the 1.0 version of workflow. It shows the same behavior: On the comment form, the workflow status of the node is presented and changed. Is this intended? I wanted to use it the way that nodes and comments have their own way to be independently moderated using a workflow.
Comment #8
nancydruOnly nodes participate in workflow. Comments are not nodes.
Comment #9
nancydruNo further update.
Comment #10
delacosta456 commentedhi
i now this is a hold issue but looks like i am in a similar scenario ..
When configuring the workflow added to the node, i decided to not show the transition form in Edit for but when viewing the node.
I would have been nice to have a kind of comment / discussion/ case tracking system for each state so that a little discussion may start for to the current state before it could be moved to next state.
i AM CORREC?
Comment #11
johnvThis issue is for the very old 7.x-1.1 version. So if you have the same problem, please raise a new issue with reference to this one.
Your question seems to be different to me. It seems you can show the Workflow history tab to the entity to show the discussion. If you enable submodule Workflow_views, you can override the page with your own view version.