Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There are some incomplete sections of the state machine views integration. That is currently blocking a fix to a workbench moderation view #1966908: Fix broken view
This patch allows for joins to the node table through {state_flow_history} and it makes the handler state_flow_entity_handler_field_available_events functional again. (It's a handler that just prints links for available events) That handler still has @todos in it.
Comment | File | Size | Author |
---|---|---|---|
#8 | dup-fix-1966920-8.patch | 1.61 KB | stevector |
#5 | views-integration--state-machine-1966920-5.patch | 7.5 KB | stevector |
#3 | views-integration--state-machine-1966920-2.patch | 7.47 KB | stevector |
#1 | views-integration--state-machine-1966920-1.patch | 7.4 KB | stevector |
Comments
Comment #1
stevectorThis patch was made on top of the changes in #1883426: Merge node/%node/state-flow-history and node/%node/revisions-state-flow-states and doesn't apply cleanly to 7.x-3.x. Let's review #1883426: Merge node/%node/state-flow-history and node/%node/revisions-state-flow-states first and get that committed.
Comment #2
stevectorComment #3
stevectorThe previous patch didn't apply cleanly because of the ordering of some lines in the state_flow_entity.info file.
Comment #4
robeano CreditAttribution: robeano commentedThe patch in comment #3 does not apply cleaning to the .info file as well.
Steps to reproduce
* drush dl state_machine-7.x-3.x
* cd state_machine/
* patch -p1 < views-integration--state-machine-1966920-2.patch
Results when applying the patch:
.rej file looks like this:
I applied the changes from the patch manually.
Test Results
* Created some Drafts
* View My Drafts tab
The links for changing state look great!
Unfortunately, I'm getting an error when viewing this tab:
* Moved some Drafts to Needs Review state
* View Needs Review tab
No revisions are displayed. Two errors are displayed and the State filter is highlighted in red:
I made sure to clear cache. Does this patch rely on another one?
Comment #5
stevectorTry
git apply
instead ofpatch -p1 <
This patch should fix that pass-by-reference error.
The State Filter highlighted in red is likely because you don't have a Needs Review state on your test site. That's part of the default setup of Workbench Workflows that show up on admin/reports/status
I'm not sure where the contextual_pre_render_links error is coming from.
Comment #6
robeano CreditAttribution: robeano commentedThe patch views-integration--state-machine-1966920-5.patch applies cleanly when I checkout from git and use git apply for the patch.
The contextual_pre_render errors went away after clearing the cache with the latest patch. PASSED!
Sure enough, when I added a Needs Review state to the workflow, the error on Needs Review went away. PASSED!
Code Review: In general, the code looks fine. If you really wanted to, you could add a docblock for the class in the plugin:
class state_flow_entity_handler_field_available_events extends views_handler_field {
in state_machine/modules/state_flow_entity/includes/views/state_flow_entity_handler_field_available_events.inc
It's fine if you commit it as is.
Comment #7
stevectorCommitted! Thanks Robeano!
http://drupalcode.org/project/state_machine.git/commit/72a57aee1ddce7dec...
Comment #8
stevectorI'm getting duplicate records in the workbench moderation view. See http://drupal.org/node/1966908#comment-7310210
Here's a fix that allow the joins to be set more explicitly.
Comment #9
robeano CreditAttribution: robeano commentedWorks for me. I saw the duplicates in My Drafts for example. I applied the patch and cleared the cache, but I still saw the dupes. I updated the node which had multiple records in My Drafts, then the duplicates went away. PASSED! This patch looks good and should be committed.
Comment #10
stevectorhttp://drupalcode.org/project/state_machine.git/commit/9dd1aead8ea78fdac...