I have found that this seems to happen when the "scanning for links" interstitial appears. I don't know what the threshold is for this...it seems to vary from save to save or server to server.

  1. Create a page with LOTS of links...enough to trigger the interstitial
  2. Save as a draft (saves OK)
  3. Publish the page (publishes OK)
  4. Edit the page and replace all the content with a simple page (e.g. a single word)
  5. Save as a draft (saves OK, but takes me to the "published" tab instead of the "draft" tab)
  6. Publish the page (publishes OK)
  7. View moderation history (all OK...can revert to previous draft)
  8. Edit the page and replace the simple page with the page from step 1
  9. Save as a draft

At this point, the interstitial appears and the content is PUBLISHED (edited to add...published by ANONYMOUS, not the logged in user)...and I can no longer revert to any drafts.

With LinkChecker off, redoing the above works as expected.

Comments

hass’s picture

Status: Active » Postponed (maintainer needs more info)

What means "interstitial"?

The batch api job runs if you add more than 100 "new" links. "New" means, not used/published anywhere else on the website. Linkchecker does not publish a node. It only looks into the node object that is currently saved with hook_node_insert/update and if $node->status == 1 it extracts the links, but it never publishes your draft node as it's not of status = 1.

I'm not using Content Moderation myself. Only Workbench moderation is in use on my sites and I have not seen any issues yet, but never tested it explicitly. Maybe Content Moderation does anything strange to hack core. Would be a lot easier to identify by a maintainer of content moderation.

hass’s picture

kpaxman’s picture

Title: Doesn't like Content Moderation? Linkchecker causing pages to be published when they are meant to be drafts. » Doesn't like Workbench Moderation? Linkchecker causing pages to be published when they are meant to be drafts.

Sorry...I am using Workbench Moderation, not Content Moderation. I don't know what I was thinking.

The "interstitial" is the "thing that appears between clicking save and viewing the node" (The "checking links" progress bar)

hass’s picture

Title: Doesn't like Workbench Moderation? Linkchecker causing pages to be published when they are meant to be drafts. » Support Workbench Moderation workflow
Version: 7.x-1.0 » 7.x-1.x-dev
Category: bug » feature
Status: Postponed (maintainer needs more info) » Active

Looks like there are some todo's.

#5. May be difficult to implement as I have no idea how I can grab the redirect path and I do not like to add custom code for every moderation module. We changed the target url already in #1054118: After batch scan the target url is not pointing to the node view and implemented a redirect to the published version. This is hard coded in linkchecker.

Issues:

  1. Once the status is draft status != 1 and cause a _hook_node_delete(). This may be a problem.
  2. Link extraction runs on every save, useless. Maybe caused by _hook_node_delete().
  3. Batch extraction may need to be postponed with Queue API and run on cron to prevent disturbing the default form submit redirection process.
hass’s picture

hass’s picture

This patch does not remove the batch extraction of links (your #5 issue). I may change this in a follow up issue to Queue API, but here it's not so critical.

Status: Postponed (maintainer needs more info) » Needs work
hass’s picture

Status: Needs work » Needs review
StatusFileSize
new2.81 KB
hass’s picture

It may not work if workbench is enabled, but the node type is not enabled for revisioning. Needs testing.

hass’s picture

Untested, but this one should work.

hass’s picture

Works for me. Can you confirm, please?

If you use the Moderate form on top of a draft to publish the content, it will not work! #1879476: Publishing a draft with workbench-moderation-moderate-form does not fire hook_node_update() needs to be fixed first.

hass’s picture

hass’s picture

Status: Needs review » Fixed

http://drupalcode.org/project/linkchecker.git/commit/e7b9dbb

Please give next DEV a try and report back.

kpaxman’s picture

I can't say I'm sure how to exhaustively test this - but following the pattern above everything now works as I'd expect.

  1. Create a page with LOTS of links...enough to trigger the interstitial
  2. Save as a draft (saves OK - no interstitial)
  3. Publish the page (publishes OK)
  4. Edit the page and replace all the content with a simple page (e.g. a single word)
  5. Save as a draft (saves OK, and takes me to the "draft" tab)
  6. Publish the page (publishes OK)
  7. View moderation history (all OK...can revert to previous draft)
  8. Edit the page and replace the simple page with the page from step 1
  9. Save as a draft
  10. Save as a draft (saves OK - no interstitial)
  11. Publish the page (publishes OK)
  12. View moderation history (all OK...can revert to previous draft)

At every step that would take me to the "draft" tab, I tried applying various states to see if anything would go wrong, and it always behaved as expected.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

added note that publisher is "anonymous"