- Issue created by @johns996
- πΊπΈUnited States mark_fullmer Tucson
Thanks for the thorough report. I've added this to the issues that need to be resolved for the next release ( π± LinkIt Release Roadmap and Issue Prioritization Active ).
- πΊπΈUnited States mark_fullmer Tucson
After some testing, I conclude this is a larger issue than simply double-encoding in files. There are related problems with both file entities and media entities. In the case of file entities, the widget save process never recognizes it as a file entity to begin with and just saves an internal:/
path. The Linkit formatter therefore doesn't even process the URL, which results in the double-encoding. In the case of Media entities, they save correctly the first time, but if the entity form with the link field with the Linkit widget is revisited, it munges the output from something like <code>/media/1
to
entity:/media/1
, which still "works" on render, but breaks the autocomplete functionality if you click on the link URL in the widget.I'll either rework this issue to further encapsulate the problem or create a separate issue that would end up resolving the issues with spaces in filenames.
- Status changed to Needs review
over 1 year ago 10:40pm 24 March 2023 - πΊπΈUnited States mark_fullmer Tucson
The attached patch handles the Drupal file entity, which is anomalous compared to other entities, separately, to ensure it can be 'found' as an entity and its URL rendered like other entities.
- πΊπΈUnited States johns996 Marquette, MI
The patch applied cleanly to my installation and fixed the issue. I tested it in both the CKEditor instance of a link field and a field using the linkit widget. Nice job Mark! Thanks for your wok on this and everything you've done to keep this great module going.
-
mark_fullmer β
committed 04604f9e on 6.0.x
Issue #3348154 by mark_fullmer, johns996: Linkit Link field: File...
-
mark_fullmer β
committed 04604f9e on 6.0.x
- Status changed to Fixed
over 1 year ago 1:33pm 25 March 2023 - πΊπΈUnited States mark_fullmer Tucson
Thanks for your work on this and everything you've done to keep this great module going.
Sure thing! Always happy to contribute to the community.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
about 1 year ago 8:13pm 21 September 2023 - πΊπΈUnited States jodelamotte
I'm experiencing a double encoding problem. I'm using Linkit version 6.0.0-rc1 Drupal Version 9.5.10, and although I've reviewed the patch and it appears to include all the necessary changes, the issue of double encoding persists.
- πΊπΈUnited States mark_fullmer Tucson
I'm experiencing a double encoding problem. I'm using Linkit version 6.0.0-rc1 Drupal Version 9.5.10, and although I've reviewed the patch and it appears to include all the necessary changes, the issue of double encoding persists.
Can you confirm that the original steps to reproduce in this issue cause the problem for you? If you aren't getting this problem with those steps, can you provide alternate steps to reproduce that are causing the issue for you? Thanks!
- πΊπΈUnited States patrickfgoddard
Can patch be modified for linkit versions 6.1 and up? We are using 6.1 and are encountering this double-encoding issue.
- π¨π¦Canada laura.j.johnson@gmail.com Toronto
We are also encountering this issue with 6.1.3 using the Linkit widget with a core formatter, in this case the Separate link text and URL formatter. And it's also with file entities.
If core link formatters expect a decoded url then it seems ideal that the Linkit widget should take care of decoding the url. I'm not sure if there is a better way to accomplish that but here is a patch that adds an urldecode() step in MassageFormValues() in LinkWidget.
Steps to reproduce:
install Linkit 6.1.x-dev
Upload a file/media with a space in the name
Edit the basic page content type, add a link field with default settings but change the form display to use the linkit widget, change the display to use a non-linkit formatter like Separate link text and URL
Create a page using the basic page content type and link to the file/media with the link field.
On the edit page the link will appear like this: /sites/default/files/2023-03/name%20with%20space.pdf
When the page is saved and viewed the link will appear like this: /sites/default/files/2023-03/name%2520with%2520space.pdf - π¨π¦Canada laura.j.johnson@gmail.com Toronto
I opened a new issue here π Linkit Link field: Double-encoded file links Active for visibility.