Project

General

Profile

Actions

Bug #84534

closed

Dots in TypoScript keys break autocomplete

Added by Henning no-lastname-given over 6 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
t3editor
Target version:
-
Start date:
2018-03-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

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
Actions #1

Updated by Guido Schmechel over 6 years 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

Thanks, Guido

Actions #2

Updated by Henning no-lastname-given over 6 years ago

Hi Guido,

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.

Actions #3

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56784

Actions #4

Updated by Guido Schmechel over 6 years ago

Hi Henning,

thanks yor your explanation. I could reproduce this issue in version 8 and 9. Maybe my patchset is too simple, but let's wait for the reviews :-)

Best, Guido

Actions #5

Updated by F Altrock almost 6 years ago

I have this issue because of ElasticSearch filter names for nested document properties, which also contain a period.
It's clogging up the logs...

So 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. (convertTypoScriptArrayToPlainArray
uses _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
suggestions. (?)
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
to handle keys with dots in them. But the JavaScript part needs to be patched too to recognize TypoScript keys
with escaped dots as one key ... the JavaScript in https://github.com/TYPO3-CMS/t3editor/tree/v9.5.1/Resources/Public/JavaScript/Addon/Hint
has plenty of foo.split('.') and bar.join('.') code.

This does not seem easy to fix.

Actions #6

Updated by Bastian Stargazer over 5 years ago

I could reproduce this issue in version 8 and 9. Maybe my patchset is too simple, but let's wait for the reviews :-)

Any news or updates on this? I'm using metatags with a dot in them as well (escaped the with a backslash like meta.geo\.position), and each click to edit the root-template throws the exception, that becomes a log flood after a while...
Working on TYPO3 9.5.4

Edit:
In TYPO3 9.5.4 the error message looks slightly different from posted by thread opener, but I guess its the same issue:

Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 1 passed to TYPO3\CMS\T3editor\Controller\CodeCompletionController::treeWalkCleanup()
must be of the type array, string given, called in [...]/libraries/typo3_src-9.5.4/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php
on line 103 | TypeError thrown in file [...]/libraries/typo3_src-9.5.4/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php in line 85.
Requested URL: https://www.mysite.com/typo3/index.php?route=%%2Fajax%%2Ft3editor%%2Fcodecompletion%%2Fload-templates&token=--AnonymizedToken--&pageId=1
Actions #7

Updated by Susanne Moog over 5 years ago

  • Status changed from Under Review to Accepted

Patch has been abandoned.

Actions #8

Updated by Benni Mack almost 5 years ago

  • Related to Bug #89124: Template TypoScript editor broken and not working added
Actions #9

Updated by Markus Klein over 4 years ago

  • Related to deleted (Bug #89124: Template TypoScript editor broken and not working)
Actions #10

Updated by Gerrit Code Review over 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63765

Actions #11

Updated by Gerrit Code Review over 4 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63854

Actions #12

Updated by Georg Ringer over 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #13

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF