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.

Command icon 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:

Comments

jasongose created an issue. See original summary.

jasongose’s picture

Issue summary: View changes
jasongose’s picture

Status: Active » Needs review

jasongose changed the visibility of the branch 3585537-link-field-support to hidden.

jasongose’s picture

Issue summary: View changes
jasongose’s picture

Issue summary: View changes
jasongose’s picture

Issue summary: View changes
terracoders’s picture

Status: Needs review » Reviewed & tested by the community

Changing status to Reviewed & tested

jasongose’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jasongose’s picture

Status: Fixed » Closed (fixed)