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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Link-After patch.png | 101.5 KB | sandeep_k |
| #7 | Link-Before patch.png | 118.51 KB | sandeep_k |
| #5 | Error Drupal 10.2.png | 98.81 KB | sandeep_k |
| #5 | Error Drupal 9.5.11.png | 97.79 KB | sandeep_k |
Issue fork redirect-3414464
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
Comment #3
pavlosdanComment #4
pavlosdanComment #5
sandeep_k commented@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)
Comment #6
pavlosdanThanks for testing this @Sandeep_k. Pushed a commit to fix the issue!
Comment #7
sandeep_k commentedThanks @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:
Testing Results:
After applying the patch, the Redirect source option is removed from the link field widget. RTBC++
Comment #8
sandeep_k commentedComment #10
berdirMerged.