Dots in TypoScript keys break autocomplete
There are <meta> properties that have dots in them like
<meta name="geo.region" content="DE-RP">
The corresponding TypoScript would look like:
page.meta.geo\.region = DE-RP
This causes the following error:
Argument 1 passed to TYPO3\CMS\T3editor\CodeCompletion::treeWalkCleanup() must be of the type array, string given, called in /var/www/app/vendor/typo3/cms/typo3/sysext/t3editor/Classes/CodeCompletion.php on line 134
#1 Updated by Guido Schmechel 10 months ago
Hi Henning, can you please recheck this issue? I can't produce this issue on 8.7.13 and current master. Maybe you can describe your case?
- Open the page template via "TEMPLATE"
- Set the values in the "Setup" area
- Wrote every letter and the popup from PAGE and META appears
#2 Updated by Henning no-lastname-given 10 months ago
sorry. Steps to reproduce:
Setup, that breaks:
page.meta.foo\.bar = baz
1. Add TypoScript progragramatically from PHP either via TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScriptSetup or ::addStaticFile + include in backend
2. Open the Template module and chose a template that is affected by the included TS
3. Open the Setup in t3editor (this should already execute an XHR request that causes the error)
4. Type something that should bring up the autocomplete wizard or force via Ctrl + Space
The XHR-request in the background will fail with the stated error.
I have this issue because of ElasticSearch filter names for nested document properties, which also contain a period.
It's clogging up the logs...
treeWalkCleanup does basically the same as
convertTypoScriptArrayToPlainArray, that is to say:
fix the keys in a TypoScript array so that a node in the tree can have a value and child nodes at the same time.
Here we generate
v-keys for values in the node and
c-keys for sub-branches. (
_typoScriptNodeValue for the values at the nodes, at the same level as the tree children.)
This is necessary because the result is serialized as JSON and used in the CodeMirror completion handler¸
and I guess the person that coded that piece of functionality did not want to have the dots in the completion
I personally have no problem at all if the T3Editor gives me names with a dot at the end as a completion, because
really, most of the time I need the dot anyway...
With this patch: https://gist.github.com/faltrock-abone/c4974a29b411d2402e2f286c3d0f5052 I fixed the backend part
has plenty of
This does not seem easy to fix.