When trying to save workflow changes from the node edit screen get the error shown in issue title, it works fine from the workflow tab though

Comments

rdeboer’s picture

Assigned: Unassigned » rdeboer

Thanks for the report Brian,
Yep this alpha version is a first D7 port, so problems are to be expected.
This particular one should be easy -- finding the time to do it is harder....
I'll do my best...
Rik

sverma’s picture

I have made a form using CCK with workflow as follows.

author->user1 (updates few fields)-> user2 (updates few other fields) -> user3 (makes some more changes)-> end

However when user1 makes the change above error comes. Whether I click on preview or save buttom same error will come.

Moving on by clicking on workflow tab does not help me as the change in field is must before changing the state.

Is there any other way for time being to edit the fields.
Thanks,

Sanjay

rdeboer’s picture

I'm hoping to have some time to look into this soon.
Rik

sverma’s picture

Thanks for you help.
Can u please tell me a way till then.
thanks again.

rdeboer’s picture

Hmm...
function workflow_tab_form_submit() DOES exist in the Workflow module, file workflow.pages.inc
The code around this hasn't changed much between D6 and D7, but for some reason the D7 version of the core forms.inc cannot find it....

hot_sauce’s picture

Hi RdeBoer,

I was just wondering if you had any time to take a look at this. I too am having the same problem as outlined above by the previous commenters. I love Workflow Extensions but desperately need it to be working for a project I am working on.

Thanks for all your hard work!

paulgrand’s picture

This patch will allow editing of the node form again, but is only removing the form handler from the node edit form. As such you'll most likely need to use the workflow tab to progress the node.

More comprehensive fix definitely needed, but this fixed the issue for my use case.

hot_sauce’s picture

Thanks for the patch paulgrand, that worked great for me!

After applying I can now save/edit nodes without any issues. I use the block that Workflow Extensions generates for my moving along process and that seemed to work fine. However you are right, more work is still needed to fix this totally because changing the state from the node edit page itself does not work.

In my case, using the block is the ideal way to handle the transitions but changing the state on the edit page is I'm sure for most people the better option.

paulgrand’s picture

Another option might be to use panels, and add the "workflow dashboard" view provided by workflow extensions to the node edit panel.

rdeboer’s picture

I've fired up my test rig, but can't seem to reproduce the error....

What are the exact steps to bring about the error?
Does it happen for admin as well as other roles?
Any specific config settings that may be relevant?

Rik

paulgrand’s picture

Not a very detailed scenario, but this was the gist of mine:
- w/flow extensions configured to be buttons.
- Try to edit node info (not workflow state) on node/x/edit
- Attempting to save the node produces the error described.

rdeboer’s picture

Hi Paul,
Which "node info" do you mean?
I've tried changing title, body, revision log, author, everything... and pressed "Save".
No error.
I tried this with core 7.15 and have just upgraded to 7.17 and I cannot reproduce this error.

Using with Workflow module 7.x-1.0+20-dev (taken from admin/modules page). Which version of Workflow are you using?

Could there be another module in the mix that causes interference?
Diff module?

Rik

adamtong’s picture

Fatal error: Call to undefined function workflow_tab_form_submit() in mydrupal/includes/form.inc on line 1464

I have the similar error when I try to update a node with any state.

I have applied the patch at #7, but still have this error.

adamtong’s picture

Fatal error: Call to undefined function workflow_tab_form_submit() in mydrupal/includes/form.inc on line 1464

I have the similar error when I try to update a node with any state.

I have applied the patch at #7, but still have this error.

dbassendine’s picture

Until this can be fixed, an alternative workaround is to remove the "change workflow state via node edit form" permission from all roles. Unfortunately, this permission wasn't working but this can be fixed with the patch in: http://drupal.org/node/1899262#comment-6984990.

The advantage of this workaround is that the workflow section is hidden entirely on the node edit form - in the other one the workflow form still displays, but just doesn't save, which could be confusing.

Hope that helps someone - David

rdeboer’s picture

Thanks so much David.
Rik

rdeboer’s picture

Title: Fatal error: Call to undefined function workflow_tab_form_submit() in /includes/form.inc on line 1460 » Single-action buttons don't work on node Edit tab, but do on node Workflow tab

The patch as mentioned in #15 has been applied.
The latest devs from both the Workflow and Workflow Extensions modules no longer produce an error.

But as mentioned in #15, the state doesn't transition either when the single-action workflow state transition buttons are used on the Edit form. They do work on the Workflow tab though.

rdeboer’s picture

Status: Active » Fixed

Fixed with latest check-in.
Also put in a more appropriate redirect for the /workflow-dashboard page.

nancydru’s picture

Status: Fixed » Active

I just pulled from Git and I'm still getting this error.

nancydru’s picture

At the end of workflow_extensions_form_submit, I added

  form_load_include($form_state, 'inc', 'workflow', 'workflow.pages');

and everything works now.

rdeboer’s picture

@NancyDru, #20:

Hmmm... would we interesting to know under what circumstances this happens, as I thought I'd tested this thoroughly and it was confirmed by another user.

I'm not against putting this line in though, except that you said elsewhere that you're going to get rid of 'workflow.pages' so by the time that happens, this line will probably produce an error, right?
In which case our uses will have to synchronise versions carefully...

Rik

nancydru’s picture

This was happening when the tab_form was enabled for the edit form. Upon saving, the workflow_tab_form_submit() could not be found. It worked fine without WE, but failed with it.

This issue was why I was looking to move that code back into the main module, but this fixes the problem, so I can leave well enough alone.

cursor’s picture

#20 works. Please commit this in.

rdeboer’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3

On 7.x-1.0-beta3 works for me without #20. That's probably because workflow.pages is already included by Workflow Extensions in 2 other places.
Anyway, while I don't believe #20 is necessary, I don't think it's harmfull either, so I just checked #20 into the 7.x-1.x branch. It will be available in the next development snapshot 7.x-1.x-dev (11 Feb 2013)

rdeboer’s picture

Status: Active » Fixed
nancydru’s picture

Thanks, Rik.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

icm’s picture

I'm still having this issue, even though I'm using the latest snapshot which has the patch from #20. The issue is that the single-action buttons DO NOT do anything when clicked on the node edit form. However, they do work on the workflow tab. I'm not using any of the blocks; instead I have the "Workflow module form showing on the edit form (ie. Structure > Content type > Manage fields). The other thing to note is that when I switch it back to use the regular dropdown menu, it does save the changes from the node edit form. It's only the single-action buttons that aren't working.

Any thoughts?

rdeboer’s picture

Status: Closed (fixed) » Active

No thoughts yet.
Have to set up a test environment and see if I reproduce the error.
Which version of Workflow are you using?
Rik

rdeboer’s picture

Can confirm this issue happens for single action buttons only (radio and drop-down work) on the Edit screen with
Workflow 7.x-1.2
Workflow Extensions 7.x-1.x-dev

All that happens is that the page refreshes. No state transition.
All is good on the Workflow tab.

Rik

rdeboer’s picture

Status: Active » Fixed

Fixed in 7.x-1.0.
Single action buttions now work on Edit form (and you can use tokens to assemble labels for the buttons).
It turned out that the code was prone to other modules interfering with the Edit form, for instance the Locale module.
Rik

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.