- Issue created by @bernardm28
- 🇺🇸United States mark_fullmer Tucson
Hrm. Sounds like some greedy JavaScript. Thanks for reporting this. I'll leave it at the "Normal" priority for now.
- 🇺🇸United States mark_fullmer Tucson
I may need some help reproducing the problem.
I set about trying to reproduce this problem and was unable to do so (running on Drupal 10.0.x), using the 6.0.x branch of this module (this only differs from the 6.1.x branch in its implementation of the CKEditor 5 plugin, so for the purposes of this issue, the branches should be interchangeable).
Here are the steps I took:
1. Create a new content type
2. Add three "Link" type fields to the content type (test, test2, test3), all set to "Unlimited instances".
3. Set the first field to "Allow link text" = "Disabled"
4. Set the second field to "Allow link text" = "Optional"
5. Set the third field to "Allow link text" = "Required"
6. Set all three fields' form display to "Linkit". (Leave all form settings at "Automatically populate link text from entity label: No")
7. Create a node of the new content type.
8. Click "Add another item" for all 3 link fields on the node, effectively producing 6 different link inputs.
9. Populate the link URL field on each of the link inputs with an internal node title and subsequently with an absolute URL.In none of the instances in Step 9 did I observe one field "hijacking" the link text value of any other field. In all instances the link text value remained the same.
I then set the field with "Optional" link text form setting to "Automatically populate link text from entity label: Yes" and was still unable to produce the 'hijacking.'
I then added the field with "Required" link text form setting to "Automatically populate link text from entity label: Yes" and was still unable to produce the 'hijacking.'
Screenshot attached.
- Status changed to Postponed: needs info
over 1 year ago 2:32pm 9 May 2023 - 🇺🇸United States bernardm28 Tennessee
Here is a video of the issue and how to reproduce it. Thanks for adding the steps above.1. Create a new content type or edit the basic page one
2. Add two "Link" type fields to the content type (Link1, Link2), all set to Limited "1".
3. Set the first field to "Allow link text" = "Disabled"
5. Set the second field to "Allow link text" = "Optional"
6. Set both fields' form display to "Linkit". (Leave both form settings to "Automatically populate link text from entity label: Yes" or because one does not have a title select the first one to say "Automatically populate link text from entity label: No" and the second link field to "Automatically populate link text from entity label: Yes" )
7. Create a node of the new content type.
8. Populate the link URL field link field 1, it will automatically populate the link field 2 title since it does not have a title of its own and one of the two fields had the Automatically populate option on.Hopefully those steps help.
- Status changed to Active
over 1 year ago 8:18pm 14 May 2023 - 🇺🇸United States mark_fullmer Tucson
Thanks for the additional info! It looks like the missing bit of information to reproduce was that one field needs to be set to "Automatically populate link title." I've updated the title and added the steps to reproduce to the issue description.
Setting back to "Active."
- Status changed to Needs review
over 1 year ago 9:01pm 14 May 2023 - last update
over 1 year ago 83 pass - 🇺🇸United States mark_fullmer Tucson
The attached patch checks that the link text field that can receive the autopopulated text has the same drupal selector (field id and delta) as the link URI that the text is coming from.
This should reliably narrow the scope so that only the URI field associated with the Link text field can populate.
- Assigned to ravi kant
- Issue was unassigned.
- 🇮🇳India ravi kant Jaipur
I have the latest Drupal version (Drupal 10 and Drupal 10 alpha) and getting "Automatically populate link text from entity label: No" in both cases. I set "yes" for both but the issue is not replicating for me.
- 🇺🇸United States mark_fullmer Tucson
"Automatically populate link text from entity label: No" in both cases. I set "yes" for both but the issue is not replicating for me.
Thanks for attempting to test. The steps to reproduce in the issue description specifically state that the first field needs to have its link text "Disabled" and the second "Optional", in additional to setting "Automatically populate link text to "yes".
- Status changed to RTBC
over 1 year ago 4:28pm 23 May 2023 - 🇺🇸United States bernardm28 Tennessee
This Patch fixes the bug. I did a test on both a vanilla Drupal 9.5.9 install and on our own website.
Thanks for the quick fix. -
mark_fullmer →
committed 3d6956d6 on 6.0.x
Issue #3358023 by mark_fullmer, bernardm28, ravi kant: When multiple...
-
mark_fullmer →
committed 3d6956d6 on 6.0.x
-
mark_fullmer →
committed 7de7abbe on 6.1.x
Issue #3358023 by mark_fullmer, bernardm28, ravi kant: When multiple...
-
mark_fullmer →
committed 7de7abbe on 6.1.x
- Status changed to Fixed
over 1 year ago 4:47pm 23 May 2023 - Open on Drupal.org →Core: 10.1.x + Environment: PHP 8.1 & MariaDB 10.3.22last update
over 1 year ago Waiting for branch to pass - @bernardm28 opened merge request.
- Status changed to Needs review
over 1 year ago 7:14pm 23 May 2023 - 🇺🇸United States bernardm28 Tennessee
I may have spoken too soon.
It works well on a content type node. But when I tried on our layout builder blocks the block will just hang.
I imagine it has to do with dropping the handlers too early with the false statement. - Status changed to Needs work
over 1 year ago 8:48pm 23 May 2023 - 🇺🇸United States bernardm28 Tennessee
I did some more testing on this today. I haven't been able to reproduce the new bug with a vanilla D9 site.
I think your fix does resolve that issue for a lot of scenarios.
That said, I did find out that changing (!== to ===) and wrapping the if statement below as shown on the merge request above seems to fix it for both scenarios. Though that seems to break one of the tests.
Why would return false halt the on-click action in some cases? I don't know yet.
We could call it fixed with the first patch and I could start a new issue if you would rather do that. - 🇺🇸United States mark_fullmer Tucson
We could call it fixed with the first patch and I could start a new issue if
you would rather do that.I think that's a great suggestion. Let's proceed that way.
- Status changed to Fixed
over 1 year ago 2:32pm 31 May 2023 - 🇺🇸United States bernardm28 Tennessee
I will open a new issue for the layout builder bug as described above.
I need to test it more on a vanilla version of Drupal to why that makes a difference. Automatically closed - issue fixed for 2 weeks with no activity.