Closed (fixed)
Project:
Workflow
Version:
7.x-1.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
3 Sep 2013 at 10:16 UTC
Updated:
9 Apr 2021 at 11:41 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedActually it should be already doing this. It fails at workflow.pages.inc, row 199:
if (!empty($node->workflow_scheduled_timestamp) && !empty($node->workflow_scheduled_sid))Those properties are not set. workflow.node.inc implements hook_node_load which sets those - is workflow.pages.inc missing that?
We are currently using workflow form on it's own tab only - not in any of node forms.
Comment #2
johnvThere has been some reshuffling of code into the new file workflow.node.inc (in the current dev-version).
Can you check if the error exists already in version 7.x-1.2 ?
Comment #3
Anonymous (not verified) commentedYes, exists in 7.x-1.2 also. Managed to fix it (temporarily :) by adding
workflow_node_load(array($node->nid => $node), array($node->type));as first line in workflow_tab_page() in workflow.pages.inc.Comment #4
johnvWhy is your change temporarily? Don't you think is a good approach?
Comment #5
Anonymous (not verified) commentedI didn't have time to test it properly but so far it seems to work just perfect.
Comment #6
johnvIs this a more precise description?
Setting to 'needs review', as #1 and #3 contain a kind-of-patch.
Comment #7
johnv@pikku-h, I have tested this now (with 1.x-dev), and my system works as expected. There must be something else.
- create a node,
- go to node/%/workflow, change status, with time in future.
- go to node/%/workflow, time form is expanded with correct data.
Comment #8
Anonymous (not verified) commentedSeems that this is because Entity cache. With it enabled, the forms shows correct info after clearing cache. With it disabled, everything works as expected.
Comment #9
johnvBetter title.
When a transition is scheduled, the current node is not updated. Therefor, Entity Cache contains old info.
Alternatives:
- do save the unchanged node, which would refresh EntityCache.
- explicitly empty the EntityCache cache (but perhaps more caches are invalid)
- do not do hook_node_load, but load the scheduled data only on the Workflow Form. (this might break API with submodules and contrib/custom modules)
- use the new Workflow Field, that loads the scheduled data only on the Workflow Form.
Comment #10
johnvThe function workflow_cron contains a statement "cache_clear_all();"
Although a more restricted cache clear is more appropriate, it could solve your use case.
Comment #11
johnvFrom this blog post
"There is one catch to using Entity Cache, it requires that you always update your entity tables using the save/delete API calls in order to ensure Entity cache knows when to invalidate the cache. But you are doing that already, right?
We should look into the way we are saving a node state change on the several forms (View, edit, workflow tab, comment).
Comment #12
johnvThis is fixed in 7.x-2.x. The Scheduled Transition is loaded every time again on the Workflow Form.
This may result in a small performance drawback. Some caching might be reintroduced some time.