- Issue created by @marc.bau
- 🇮🇳India vinmayiswamy
Hi, I’ve reproduced the issue with the
Link to URI
formatter in Drupal 10.3.2. I configured a view to trim URLs to 40 characters, which results in URLs being truncated to "..." and becoming non-clickable.In my investigation, I added debug statements and found that while URL truncation works correctly, the HTML generated by the formatter is incorrect. Specifically, the link HTML element is not rendered as a clickable link after truncation. This suggests that the truncation is impacting the HTML anchor tag generation.
The proposed resolution to use
l(_filter_url_trim($link->url, 40), $link->url)
seems to be a good approach to address this issue. I will look into applying this method to see if it resolves the problem.I did not use the linkchecker module because it is throwing a deprecation error, which prevents me from checking broken links. The module's installed version is 2.0.0, and the error message is:
Deprecated function: Creation of dynamic property Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm::$moduleHandler is deprecated in Drupal\linkchecker\Form\LinkCheckerAdminSettingsForm->__construct() (line 96 of modules/contrib/linkchecker/src/Form/LinkCheckerAdminSettingsForm.php).
I’ll update further once I explore the proposed resolution. Kindly please let me know if there are any additional details I should consider and any suggestions or guidance would be greatly appreciated.
Thanks!
- 🇩🇪Germany marc.bau
You can find the broken links report view at
admin/reports/linkchecker
. The first colum is the URL field.The deprecation is not causing this url issue, but need to be fixed for sure, too. :-)
- 🇳🇱Netherlands Lendude Amsterdam
Feels related to 🐛 Field options "Rewrite results" and "Link to the Content" applied together is not working as expected Needs work
- 🇳🇿New Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.