Bug #79834
closedSuggestions with "placeholder" fetches first result in database
0%
Description
Hello there,
when using placeholders for fields (infamously well known for it's use in file description/title/alternative in textpic elements), it may happen that a suggestion for another language is shown instead of the language of the currently related record.
This can be recreated by doing the following:
- upload an image file
- create meta information in a translation
- create any additional metadata information for the default language (mind the order here)
- create a textpic element and link the file
- in the original language you'll see the alternative text of the translation shown as placeholder
In the frontend, everything is fine in the end, since the relation is properly resolved, but in the backend, redactors are often confused when this happens, as this isn't a behavior they'd expect.
The reason why this happens lays in how the placeholder is generated in backend/Classes/Form/FormDataProvider/TcaInputPlaceholder.php
.
I could not exactly figure out where this happens, but pretty well why.
Since the TCA definition for the placeholder is __row|uid_local|metadata|alternative
(which is pretty clever and elegant IMHO) there is no way, internally, to know the language of the parent and therefore get the proper language, but I think that it's in the placeholder where this should be implemented somehow.
Please let me know if you need anymore information.
Regards
Tizian