Problem/Motivation
Currently, entities are processed regardless of status.
It would be nice to be able to skipignore items that are not published (status=0)
Proposed resolution
Add the option to enable only processing processing published items (status=1) and the logic to support doing so.
User interface changes
This adds a new option to the configuration page: 'Ignore unpublished'
Test
First, make sure the 'Ignore unpublished' setting is FALSE (this is not the default. Don't forget to click the save button when you update it on the configuration page)
Add/Edit a page and set to the status to "Unpublished" (specifically, status needs to be '0').
Run link magician page: drush link_magician:tidy nodeid --nodeid=NNNN
Get the batch ID: drush sql:query 'SELECT id FROM link_magician_batch ORDER BY id DESC LIMIT 1'
See the "skipped" results (/admin/link_magician/tracking/results/skipped/{batchid}) and "updated" results (/admin/link_magician/tracking/results/updated/{batchid}); the page will not be listed. *note* this is normal for page w/o any urls/links checked and you can repeat this test with a url link in the body so that the tidy process will have something to include in the results.
Update the 'Ignore unpublished' setting to TRUE (this is the default. Don't forget to click the save button when you updated it on the configuration page).
Run link magician page: drush link_magician:tidy nodeid --nodeid=NNNN
Get the batch ID: drush sql:query 'SELECT id FROM link_magician_batch ORDER BY id DESC LIMIT 1'
See the "skipped" results (/admin/link_magician/tracking/results/skipped/{batchid}); there will be an "Unpublished content" skip message.
You can repeat this test with a url/link that Link Magician would normally update in order to verify the "updated" results (/admin/link_magician/tracking/results/updated/{batchid}) will not list updates for the page.
Issue fork link_magician-3586085
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3586085-ability-to-skip
changes, plain diff MR !12
- 3585537-link-field-support
changes, plain diff MR !14
Comments
Comment #3
jasongose commentedComment #4
jasongose commentedComment #7
jasongose commentedComment #8
jasongose commentedComment #9
jasongose commentedComment #10
terracoders commentedChanging status to Reviewed & tested
Comment #11
jasongose commentedComment #13
jasongose commented