in2code-de/lux

Do not delete link after deletion of lux-linklistener

scheibome opened this issue · 2 comments

At the moment it behaves in such a way that if a lux-linklistener is deleted, the link (href) is replaced by "nothing" and the link no longer works.
It would be nice if the actual saved link would then be used again.

Example:
<f:link.typolink parameter="35" additionalAttributes="{data-lux-linklistener:2}">Test</f:link.typolink>

If now the lux-linklistener is missing in the database or deleted the following appears as output in the FE.
<a href="" data-lux-linklistener="2">Test</a>

Expected behavior would be:
<a href="/impressum" data-lux-linklistener="2">Test</a>

Tested in version 24.0.1

Puh, I understand your request and I also think that this would be a better link rendering behaviour compared to now. But to be honest, I'm not sure how to fix this in a quick way.
At the moment the link rewrite is done via TypoScript (see https://github.com/in2code-de/lux/blob/develop/Configuration/TypoScript/Lux/12_LinkhandlerConfiguration.typoscript).
I played a bit (my TypoScript knowledge isn't that good any more) but without a quick win.
I think, if we really want to fix this, we have to write our own LinkHandler class like it's done in news (see official documentation: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/LinkBrowser/Linkhandler/Index.html#example-news-records-from-one-storage-pid).
Is this a showstopper that must be fixed for your project?

It's not a showstopper for a current project, it just came to attention because the links were no longer available because the database entries of LUX were missing in the dump.

The same happens when an editor carelessly removes a listener.