Problem/Motivation

Relative links aren't handled correctly.

Steps to reproduce

Create a page with a relative link in a field (one that Link Magician will process).
Run Tidy on the page.
Check the 'Skipped' results for the batch (/admin/link_magician/tracking/results/skipped/{batchid})

Proposed resolution

The code in processAnchorTags and processImageTags both ignore the fact that url's in src/href can be relative and should be updated to account for relative links.

Test

Create 2 pages:

  1. "Test Page - Child" with the URL alias set to /test/child
  2. "Test Page - Parent" with the URL alias set to /test/parent with a relative link to the child:
    <a href="child">Child page</a>

Run link magician on the parent page: drush link_magician:tidy nodeid --nodeid=NNNN
See the "Updated" results (/admin/link_magician/tracking/results/updated/{batchid}). You should see an update to the link listed.

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

I plan to clean up the commit message at merge :)

jasongose’s picture

Issue summary: View changes

Updated the test steps to have the correct "Update" page.

cameron prince’s picture

Status: Needs review » Reviewed & tested by the community

Testing step pass. Marking RTBC!

jasongose’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!
(Merged)

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)