Project

General

Profile

Actions

Bug #89124

closed

Template TypoScript editor broken and not working

Added by Bastian Stargazer about 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2019-09-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
template, editor, typoscript
Complexity:
Is Regression:
Sprint Focus:

Description

For test purpose I have updated a project from v9.5 to v10. Everything seems to working great, except the template editor for TypoScript. First its loading fine, for a second the both textareas for Constants and Setup are displayed, but than it totally messes up. The textboxes disappear and all the TypoScript lines are displayed in weired non-editable lines (see screenshot). Guessing its a JavaScript error which is parsing the TypoScript content wrong (but nothing is printed to the browser console). Same happens also if I create a new Site Template on a new root page.

I've tested it in Firefox and Chromium with same result.

System:
Ubuntu 18, Apache 2.4, PHP 7.2, Application context is "Development".
I've only the extension bootstrap_package v11.0.0 installed.


Files

screenshot-t3-ts-error.png (33.6 KB) screenshot-t3-ts-error.png Bastian Stargazer, 2019-09-10 11:34
screenshot-t3-ts-error2.png (74 KB) screenshot-t3-ts-error2.png Bastian Stargazer, 2020-03-13 12:25
t3-js-404s2.png (198 KB) t3-js-404s2.png Bastian Stargazer, 2020-03-13 13:01
KO-dashboard.png (215 KB) KO-dashboard.png Davide Alghi, 2020-03-13 15:41
KO-template.png (110 KB) KO-template.png Davide Alghi, 2020-03-13 15:41
KO-log.png (217 KB) KO-log.png Davide Alghi, 2020-03-13 15:41
OK-dashboard.png (226 KB) OK-dashboard.png Davide Alghi, 2020-03-13 15:41
OK-template.png (114 KB) OK-template.png Davide Alghi, 2020-03-13 15:41
phpInfo.pdf (605 KB) phpInfo.pdf Davide Alghi, 2020-03-13 15:41
KO-dashboard error.jpg (128 KB) KO-dashboard error.jpg domain name + BE|debug=0 + Dev-context Markus Klein, 2020-03-13 20:41

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #90689: ResourceCompressor can't deal with paths relative to docroot (Reoccurrence)Closed2020-03-09

Actions
Has duplicate TYPO3 Core - Bug #89909: Template Editor: Text fields "Setup" and "Constants" disappearsClosed2019-12-10

Actions
Actions #1

Updated by Christian Eßl about 5 years ago

Can't reproduce this in 10.2.0-dev. What kind of javascript errors are logged to the console?

Actions #2

Updated by Riccardo De Contardi about 5 years ago

If it is an update, I'd also try to clear every cache, temporary file and browser cache.

Actions #3

Updated by Riccardo De Contardi almost 5 years ago

I tried to reproduce this issue with

- installing a fresh TYPO3 9.5 version
- updating it to 10.2

But I was not able to reproduce it :(

We would need more detail, do you have php errors? Javascript errors?

Actions #4

Updated by Benni Mack almost 5 years ago

  • Status changed from New to Closed

Hey Bastian,

I will close this issue now, seems like we fixed this with the latest 10.2 version. Feel free to contact me if you still experience this issue so I can re-open the ticket then.

Actions #5

Updated by Bastian Stargazer almost 5 years ago

  • Priority changed from Should have to Must have
  • % Done changed from 0 to 100
  • PHP Version deleted (7.2)

Good Morning,
it seems I was not fast enough after I received the first email Riccardo today morning ;-)
As you closed the issues I was just setting up a test environment of the same v9.5 project to update it again.

Anyway, now I was able to successfully update it to 10.2.2, everything works like charm and the issue seems to be gone.
Thanks and have a good day!

Actions #6

Updated by Davide Alghi almost 5 years ago

Bastian Stargazer wrote:

For test purpose I have updated a project from v9.5 to v10. Everything seems to working great, except the template editor for TypoScript. First its loading fine, for a second the both textareas for Constants and Setup are displayed, but than it totally messes up. The textboxes disappear and all the TypoScript lines are displayed in weired non-editable lines (see screenshot). Guessing its a JavaScript error which is parsing the TypoScript content wrong (but nothing is printed to the browser console). Same happens also if I create a new Site Template on a new root page.

I've tested it in Firefox and Chromium with same result.

System:
Ubuntu 18, Apache 2.4, PHP 7.2, Application context is "Development".
I've only the extension bootstrap_package v11.0.0 installed.

I know, I'm replying to a closed issue, but I'm having the same problem.
The bug issues if T3 is accessed without domain and in live preset: in debug mode everything works fine.
To reproduce the problem, T3 10.2.2 fresh installation without domain, simple path with IP address, and live preset.

t3editor.css and codemirror.css are not included into compressed file.
Passed paths ($filesToInclude) into TYPO3\CMS\Core\Resource\ResourceCompressor::createMergedFile() are wrong for t3editor css files.

https://forge.typo3.org/projects/typo3cms-core/repository/revisions/fa12539145ff0fc056e6f2d5aa2a6ddfb9eaed47/entry/typo3/sysext/core/Classes/Resource/ResourceCompressor.php#L234

I fixed (better workarounded) with

$this->resultArray['stylesheetFiles'][] = 'EXT:t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css';
$this->resultArray['stylesheetFiles'][] = 'EXT:t3editor/Resources/Public/Css/t3editor.css';

in
https://forge.typo3.org/projects/typo3cms-core/repository/revisions/fa12539145ff0fc056e6f2d5aa2a6ddfb9eaed47/entry/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php#L100

I said "workarounded" because the problem is not issued in T3 9.5 and TYPO3\CMS\T3editor\Form\Element\T3editorElement::render() code is the same. I think the bug is not here, but this is a starting point to investigate.

PS: leading slash is redundant in (but this is not the problem)
https://forge.typo3.org/projects/typo3cms-core/repository/revisions/fa12539145ff0fc056e6f2d5aa2a6ddfb9eaed47/entry/typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php#L101

Actions #7

Updated by Benni Mack almost 5 years ago

  • Status changed from Closed to New

Thanks! Re-opened!

Actions #8

Updated by Bastian Stargazer almost 5 years ago

Davide Alghi wrote:

To reproduce the problem, T3 10.2.2 fresh installation without domain, simple path with IP address, and live preset.

You're right! My test installation was set to Development context. After switching to Production, the issue occurs again.

But I'm not sure if your conclusion about the CSS files matches in my case. Because I see the TypoScript Editor (both for Constants and Setup) rendered and displayed successfully, but just for a blink of a second. Than it messes up.

What I have just observed is, that after the page is rendered and the editors are displayed, 3 AJAX requests are made and one fails:
1) /typo3/index.php?route=/ajax/usersettings/process&token=[...]&action=getAll HTTP/1.1 200 OK
2) /typo3/index.php?route=/ajax/t3editor/tsref&token=[...] HTTP/1.1 200 OK
3) /typo3/index.php?route=/ajax/t3editor/codecompletion/load-templates&token=[...]&pageId=9 HTTP/1.1 500 ERROR

The exception thrown at this request is:
Argument 1 passed to TYPO3\CMS\T3editor\Controller\CodeCompletionController::treeWalkCleanup() must be of the type array, string given, called in /home/[...]/typo3_src-10.2.2/typo3/sysext/t3editor/Classes/Controller/CodeCompletionController.php on line 103

What makes it really strange is after I switch back to Development context, the same error is thrown if I open the TS editor, but still its usable (not get messed up).
I've seen this exception in all of my live-installations in the syslog after editing any TypoScript (using the editor). It seems to have no sideeffects so I was good with this (there is even a open Issue for that: https://forge.typo3.org/issues/84534). But now I got curious and started digging a bit more, it seems the issues are related.

It simply comes from TypoScript with a dot like described in #84534. To reproduce:

// Constants:
page.meta {
  geo.position = abc // escaping the dot has no effect, error is thrown ether way
  geo.placename = mno
  geo.region = xyz
}

// Setup:
page.meta {
  geo\.position = {$page.meta.geo.position} // escaping the dot has no effect, error is thrown ether way
  geo\.placename = {$page.meta.geo.placename}
  geo\.region = {$page.meta.geo.region}
}

So, we can close this and upvote #84534 instead?! :D

Actions #9

Updated by Benni Mack almost 5 years ago

  • Related to Bug #84534: Dots in TypoScript keys break autocomplete added
Actions #10

Updated by Georg Ringer almost 5 years ago

  • Has duplicate Bug #89909: Template Editor: Text fields "Setup" and "Constants" disappears added
Actions #11

Updated by Jochen Mo almost 5 years ago

Hello everyone. Thanks for checking! I checked the issue again today and it still occurs in the lastest version of TYPO3, v10.2.2 which is installed.

Actions #12

Updated by Georg Ringer over 4 years ago

  • Target version set to 10 LTS
Actions #13

Updated by Benni Mack over 4 years ago

  • Related to Bug #90689: ResourceCompressor can't deal with paths relative to docroot (Reoccurrence) added
Actions #14

Updated by Frank Nägler over 4 years ago

  • Status changed from New to Needs Feedback

Hello and thank you for your report.
We can't reproduce the issue with the current master branch.
We think this issue could be solved with another issue in the past.

Can you please check if this issue still exists?

Updated by Bastian Stargazer over 4 years ago

Frank Naegler wrote:

Can you please check if this issue still exists?

Unfortunately the issue still exists in 10.4.0-dev (hope that is the current master branch). Here is what I did:

$ git clone git://git.typo3.org/Packages/TYPO3.CMS.git typo3-test
$ cd typo3-test
$ composer install

- Run TYPO3 installer
- Created new Root-Page
- Created new template in Template module ("Create template for a new site")
- After clicking on "Edit the whole template record" the constant/setup textareas showing up for 1 sek. with their values and than becoming messed up again (see screenshot attached).

Because recently I had trouble working in v10 as relative path installation (see #90689), I checked if this issue might be related. So I setup devv and start this instance served from a proper domain. Result: its working better! At least the constant/setup editor seems to work, BUT only half of the time, because lots of JS files can't be loaded and throw a 404 (see second screenshot).

Strangely enough the template editing seems to work if you click the "edit" button inside the list-module. If you are in the template-module and using the "Edit the whole template record" button, the JS files can't be loaded. It's very wired and hard to produce (because sometimes it seems to work if you switch from list to template module the first time. But second click again results in JS 404s).

Updated by Davide Alghi over 4 years ago

I just tested with master branch: problem persists, but, as I said in my previous comment, only with IP address; bug disappears when I use domain as address.
I've also problem with dashboard rendering. I attached KO and OK screenshots; my phpInfo too.

Copying from Bastian Stargazer, my steps:

  • git clone git://git.typo3.org/Packages/TYPO3.CMS.git
  • composer install
  • run installer

then

  • accessed to BE (by IP address)
  • created root page
  • added a template record on root page
  • constants and setup textarea are not there

but ... on same installation by domain address (the problem disappears)

  • added a template record on root page
  • constants and setup textarea are there
Actions #17

Updated by Bastian Stargazer over 4 years ago

Oh sh** you're right, I've overseen again your previous hint related to the IP address... sorry.
I can confirm this, as I'm accessing my dev-server by IP address.

Actions #18

Updated by Davide Alghi over 4 years ago

sorry?!? for what? ;)

Actions #19

Updated by Markus Klein over 4 years ago

I can reproduce the problem with the following setup:

  1. DNS: localhost
  2. Core in subfolder "t3"
  3. BE|debug = false
  4. SYS|displayErrors = 1
  5. SYS|exceptionalErrors = 12290,
  6. ApplicationContext = Development
Actions #20

Updated by Markus Klein over 4 years ago

  • Category changed from TypoScript to Backend API
  • Status changed from Needs Feedback to Accepted
  • % Done changed from 100 to 0
Actions #21

Updated by Markus Klein over 4 years ago

file_get_contents(/var/www/html/t3/typo3//t3/typo3/sysext/t3editor/Resources/Public/JavaScript/Contrib/cm/lib/codemirror.css)
Actions #22

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/+/63714

Actions #23

Updated by Markus Klein over 4 years ago

  • Related to deleted (Bug #84534: Dots in TypoScript keys break autocomplete)
Actions #24

Updated by Gerrit Code Review over 4 years ago

Patch set 2 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/+/63714

Actions #25

Updated by Gerrit Code Review over 4 years ago

Patch set 3 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/+/63714

Actions #26

Updated by Gerrit Code Review over 4 years ago

Patch set 4 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/+/63714

Actions #27

Updated by Gerrit Code Review over 4 years ago

Patch set 5 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/+/63714

Actions #28

Updated by Davide Alghi over 4 years ago

I just tested "Patch set 5" and it works for me.
Both dashboard rendering and template constants/setup editing.
Both IP and domain addressing work.

Actions #29

Updated by Bastian Stargazer over 4 years ago

Davide Alghi wrote:

I just tested "Patch set 5" and it works for me.

Same for me, issue solved.

Actions #30

Updated by Gerrit Code Review over 4 years ago

Patch set 6 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/+/63714

Actions #31

Updated by Gerrit Code Review over 4 years ago

Patch set 7 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/+/63714

Actions #32

Updated by Gerrit Code Review over 4 years ago

Patch set 8 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/+/63714

Actions #33

Updated by Gerrit Code Review over 4 years ago

Patch set 9 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/+/63714

Actions #34

Updated by Gerrit Code Review over 4 years ago

Patch set 10 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/+/63714

Actions #35

Updated by Gerrit Code Review over 4 years ago

Patch set 11 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/+/63714

Actions #36

Updated by Gerrit Code Review over 4 years ago

Patch set 12 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/+/63714

Actions #37

Updated by Gerrit Code Review over 4 years ago

Patch set 13 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/+/63714

Actions #38

Updated by Gerrit Code Review over 4 years ago

Patch set 14 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/+/63714

Actions #39

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/+/63773

Actions #40

Updated by Gerrit Code Review over 4 years ago

Patch set 2 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/+/63773

Actions #41

Updated by Gerrit Code Review over 4 years ago

Patch set 3 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/+/63773

Actions #42

Updated by Markus Klein over 4 years ago

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

Updated by Benni Mack over 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF