Problem/Motivation

The redirect source widget is available for any link fields which can cause confusion to site builders. Since (according to the note above the widget annotation) this is meant only for the source field of the redirect entity lets make it only applicable to the redirect entity.

Steps to reproduce

  • Install redirect module
  • Add a content type and add a link field to it
  • Go to the form display for the content type and click the drop down for the link field widget. Redirect source will be available for selection.

Proposed resolution

Use the field widget isApplicable function to only apply the widget to the redirect entity.

Remaining tasks

- Discuss

User interface changes

None for redirect module. Redirect source will be removed as an option from link fields elsewhere on Drupal.

Issue fork redirect-3414464

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

pavlosdan created an issue. See original summary.

pavlosdan’s picture

Status: Active » Needs review
pavlosdan’s picture

Title: Redirect source plugin » Redirect source widget should not be available for other entities
sandeep_k’s picture

StatusFileSize
new97.79 KB
new98.81 KB

@pavlosdan, I've Tested the shared patch MR !76 mergeable on Drupal 9.5 & 10.2 versions, The Patch was applied successfully on both versions but after applying the patch when we revisited the content type & clicked on - Manage Form Display> Getting this error (Error attached)

pavlosdan’s picture

Thanks for testing this @Sandeep_k. Pushed a commit to fix the issue!

sandeep_k’s picture

StatusFileSize
new118.51 KB
new101.5 KB

Thanks @pavlosdan, I've Tested the updated MR- MR !76 mergeable on Drupal 9.5 & 10.2 versions, The Patch was applied successfully and looks good to me now.

Testing Steps:

  • Install Redirect module.
  • Add a content type and add a link field to it.
  • Go to> Content> Form display for the content type and click the drop-down for the link field widget to reproduce this- Before results are attached.
  • Download the shared patch & apply.
  • Go to> Content> Form display for the content type and click the drop to reverify this.

Testing Results:
After applying the patch, the Redirect source option is removed from the link field widget. RTBC++

sandeep_k’s picture

Status: Needs review » Reviewed & tested by the community

Berdir made their first commit to this issue’s fork.

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Merged.

  • Berdir committed 69303ac2 on 8.x-1.x authored by pavlosdan
    Issue #3414464 by pavlosdan, Berdir: Redirect source widget should not...

Status: Fixed » Closed (fixed)

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