For already published content getting revised on our site:
Good news = our users can see their edits by clicking the "Edit draft" tab
Bad news = our users cannot preview what their edits will look like before publishing them by clicking the "View draft" tab
When I viewed all of the different revisions of the page myself, I couldn't see the draft version of the page created by clicking the View link provided. I could only see their revisions by clicking "Edit draft" from the page itself. I noticed from issue report "Edit draft" opens published revision instead of draft revision that they're experiencing almost the opposite issue, so I'm baffled. Has anyone else experienced this? Does anyone have any ideas on how I can troubleshoot this issue? Thanks for any help.
J
Replication Steps
There may be other ways to replicate this issue, but you can easily see it when using the restws module.
- Install Drupal 7.38
- Install Workbench Moderation and Restws
- Apply the patch from #1838640: restws_page_callback() breaks workbench_moderation (required to fix white screen issue unrelated to this issue)
- Enable workbench moderation for a content type
- Create moderated content as published
- Create a draft of that content
- Attempt to view the draft, you should see the published revision.
| Comment | File | Size | Author |
|---|---|---|---|
| #45 | workbench-moderation-show-draft-2447659-45.patch | 816 bytes | devin carlson |
| #44 | workbench_moderation_draft.patch | 599 bytes | RumpledElf |
| #31 | workbench-moderation-show-draft-2447659-31.patch | 830 bytes | mallezie |
| #19 | workbench-moderation-show-draft-2447659-19.patch | 685 bytes | mallezie |
| #15 | workbench_moderation--fix-view-draft--2447659-14.patch | 1.15 KB | dgtlmoon |
Comments
Comment #1
mnlund commentedWe are also experiencing the same issue here. We will look further into it and try to find out why.
Comment #2
katannshaw commentedGreat! Thanks ramsalt. Please let me know if there's any patch testing that I can help out with.
Comment #3
mnlund commentedHi jayhawkfan75. Are you using Panels and Display suite?
Comment #4
katannshaw commentedNo I'm not using either of those modules. I only use the core edit form for all of my content.
Comment #5
gremy commentedI found the bug in the nodedraft.inc file.
The
workbench_moderation_nodedraft()function is returning$function($node);instead of$function($current_node);Comment #6
gremy commentedThis is the patch to fix this problem.
Comment #8
katannshaw commentedHi gremy,
Thanks for working on the patch. After installing the patch, I tested it out however it didn't solve the issue for me. This is how I reproduced the issue:
Original body value = "The is a page description." (with only one period at the end)
On an existing content page, I:
RESULT:
body = The is a page description. (no change from original)
body = The is a page description. (no change from original)
body = The is a page description... (edit page with change)
Comment #9
zoheir.nabavi commentedI am assuming we are facing the same problem here. Workflow and everything is setup nicely, however when 'saving a draft', or clicking on 'view draft' gives WSOD (White screen) on:
/node/1126/revisions/1413/view
and
/node/1126/draft
Cheers,
Comment #10
katannshaw commented@znabavi: Not sure if it's related. I don't get a WSOD on my side. Creating and saving a draft works, but when clicking 'view draft', I'm shown the live/published view instead of the draft view. So there's no way for me to see what the draft view looks like before publishing it. I can only see the draft content entered when editing the page.
Comment #11
zoheir.nabavi commentedI think WSOD was mainly because of my setup but had to setup development module + rsyslog in order to see the underlying issue was related to: https://www.drupal.org/node/1838640
Comment #12
t14 commentedI am getting the WSOD.
This happens when you have a published node and a draft version. When you click View draft WSOD appears.
I see this error in my error logs from the core common.inc file
[] operator not supported for strings in includes/common.inc on line 2487
Seems like it is related to the class attribute in a link not being and array.
Any ideas???
UPDATE
Sorry false alarm. This was related to a custom implementation of hook_men_alter not using an array for the link class.
Thanks for a great module.
Comment #13
jasonlttl commentedI looked at the patch in #6 and this did not work for me. Then I traced execution.
To me, it looks like we're losing track of the proper revision in workbench_moderation_router_item_page_callback. The correct node/vid is passed into this function, but when we call menu_get_item, $router_item['page_arguments'] is populated with the published version of the node... and so the correct vid is discarded.
If I change our version of workbench_moderation_router_item_page_callback to this, it seems to work both with and without restws (which takes over some paths) installed.
Comment #14
dgtlmoon commentedMarking as major, sounds like broken functionality at the core use case of the module
Comment #15
dgtlmoon commentedPatch of the above from @jasonlttl
Looks like his changes above also incorporate #1838640: restws_page_callback() breaks workbench_moderation ?
This patch makes the issue go away for me however not when panels is installed (even after I uninstall panels theres still some issue)
Comment #16
dgtlmoon commentedComment #17
katannshaw commented@dgtlmoon: Thanks for the patch. I tried it out on my test install and this is unfortunately what happens for me:
Has anyone else has this experience?
Comment #18
dgtlmoon commentedAre you using panels? if so, try patch from comment #29 and if not, #40 from #1285090: Panels /node/%/edit forms
Comment #19
mallezieI've simplified the patch in #15
I'm not really sure if i could remove all the checks, but this seems to be working for me.
Let the testbot decide further ;-)
I've removed the change from #1838640: restws_page_callback() breaks workbench_moderation, i think it's easier to leave those two issues seperate, to hopefully get a faster fix.
Comment #21
katannshaw commented@dgtlmoon: I am not using Panels.
@mallezie: I'll give this new patch from #19 a try later today. Thanks.
Comment #22
adamps commentedI'm new to this module, just trying to evaluate it for a site, hence scanning the open issues. I don't see this problem on my site with fairly minimal other modules installed. Scanning the comments, Panels may be relevant, and I don't have that on my test site.
Looking at the most recent patch, it seems that the lines being altered relate to calling the existing router function - which could be different depending on other modules and configuration. At a guess, the router function on my site always picks the latest revision so it's fine. However some other function looks at node->vid and it breaks.
So potentially care needs to be taken - the people who have hit this bug will likely test the fix with the particular scenario where there is a bug. My suggestion is
Thanks!
Comment #23
mallezieJust to add to @AdamPS's comment.
I'm using this patch and #1838640: restws_page_callback() breaks workbench_moderation on a site in combination with the restws module. I'm not using panels on that site.
Comment #24
katannshaw commentedThis unrelated issue with the Revisioning module solved my OP issue today: #2499985: Non-admin users can't see new published and revised content even though they have the right permissions. I disabled and uninstalled the Revisioning module, and then everything started working properly for me with the Workbench Moderation module's stages as well. Can anyone else verify this?
Edit: Removing the Revisioning module fixed several related issues however it didn't fix this issue after all. Installing patch #31 solved my issue as noted on comment #31.
Comment #25
jeebsuk commentedJust wanted to add that the patch in #19 solved the issues we were having with this scenario so +1 for #19.
Comment #26
samueljmurray commented#19 along with the patch in #23 from #1838640: restws_page_callback() breaks workbench_moderation is fixing these incompatibilities with Restws for me
Comment #27
samuel.mortensonComment #28
samuel.mortensonAdded replication steps per @AdamPS's comment, moving to Needs Review as this has fixed issues for multiple people and can be easily replicated by maintainers.
Comment #29
adamps commentedOK, thanks for the diligence
Comment #30
njbarrett commentedOn patch #19
the $last variable is never used, what is the purpose of this line?
Comment #31
mallezie@njbarret that line could indeed be removed. Nice find.
Comment #32
katannshaw commented@mallezie: Patch #31 solved my issue as noted on my edit of comment #24. Thanks so much! Ready for RTBC?
Comment #33
mallezieTests pass, and you tested it, so you could mark it RTBC I guess.
Comment #34
katannshaw commentedWith several successful tests I'm marking this RTBC. More tests are always helpful though (AdamPS and others?)
Comment #35
rich.yumul commentedThe above mentioned patches didn't work for me.
Whenever I sent to /node/[nid]/draft, I'd still see the published version and not the draft revision.
When I investigated it, it looks like the menu handler for /node/[nid]/revisions/[revision_id]/view brought up the proper revisions.
What worked for me was to just setup a redirect to that url in workbench_moderation_node_view_draft().
Comment #37
njbarrett commented@rich.yumul Your patch does not apply.
Back to RTBC for the working patch #31
Comment #38
tahiticlic commentedHi,
I've the same problem, but I guess it is because I use page manager. Can you confirm that Workbench cannot work along with page manager ? i.e. draft can't be seen if page manager is involved with a variant
As I've gone through the backtrace, somewhere page manager calls handlers giving them nid and not node, this way there's no possibility to show draft...
By the way, I can't figure out what the #31 patch is dealing with : the return function is the same with same arguments, so the added lines are just noise, isn't it ?
Regards,
Comment #39
tahiticlic commentedWell, for those who has the same problem, here is a solution : https://www.drupal.org/node/2020325
Comment #40
spinsheet commentedI'm not using Panels and having the same issue. I applied patch #31 but the 'View draft' tab is still showing the published version while the 'Edit draft' tab allows editing the draft. I'm using Workbench Moderation 7.x-1.4.
I'm noticing this is only affecting custom fields. Anything in the Body field renders as expected. Anything in one of the page's custom fields only shows what is published even though you're viewing the 'View draft' tab. I've updated Entity API to its latest version but still not working.
Comment #41
chrisgross commentedThis patch no longer applies to 1.x-dev. I tried to re-roll it, but it looks like this patch changes the same code modified by https://www.drupal.org/node/1838640
Comment #42
dgtlmoon commentedSince this was not committed and does not apply to 1.x-dev, updating status.
Comment #43
RumpledElf commentedI tried one of the patches further up the thread and it didn't apply. But what was in the patch worked.
Made a new patch, may help someone.
Comment #44
RumpledElf commentedComment #45
devin carlson commentedA reroll of #31 for 7.x-3.x.
Comment #46
mqannehTested with dev version and still having the same issue.
View draft will view the published version of the node.
Comment #47
jrglasgow commentedI saw the same issue but in testing with 7.x-3.x-dev I see that the issue is no longer there. It appears that this is a duplicate of #2021903 which was fixed last month with this commit http://drupalcode.org/workbench_moderation/commit/?id=11fdb6f
Comment #48
devaraj johnson commentedStill facing the issue any update on why it is not editing the proper revision