Bug #92972

Softref parsers should take syntax format of field into account

Added by Sybille Peters about 2 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-12-02
Due date:
% Done:

0%

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

Description

Suggestion

  • make it possible to always set "format" for TCA column type "text" and "input"
  • use the format in the softref parsers

Explanation

Currently, AFAIK, the softref parser does not evaluate what format the field has. Possible formats can be HTML (e.g. tt_content.bodytext), plain text, TypoScript (e.g. sys_template.config, sys_template.constants), comma separated list.

The format can already (partly) be set in TCA, but only if type is 'text' and 'renderType' is 't3editor', for example as 'typoscript' for sys_template.config.

Since t3editor is used only for typoscript it does not really seem to make sense that the format can be set for this renderType but not for renderType default.

renderType='t3editor': System extension “t3editor” provides an enhanced textarea for TypoScript input

format: The value specifies the language t3editor should handle. Allowed values: css, html, javascript, php, typoscript, xml

For tt_content.bodytext neither renderType nor format are set.

If this is handled consistently, you would not have to pass 'linklist' to the softref parser, but read this from format as well (e.g. for findRef_typolink()).

By being able to handle the formatting consistently in all softref parsers, it might be possible to simplify things and also avoid inconsistencies.

Examples:

Currently, URLs in comments in sys_template config or constants are added to the reference index, e.g.

sys_template.config:
# https://example.org

When saved, this record is created:

+----------------------------------+--------------+--------+--------+-------------+-------------+------------+---------+---------+-----------+-----------+---------+---------------------+
| hash                             | tablename    | recuid | field  | flexpointer | softref_key | softref_id | sorting | deleted | workspace | ref_table | ref_uid | ref_string          |
+----------------------------------+--------------+--------+--------+-------------+-------------+------------+---------+---------+-----------+-----------+---------+---------------------+
| a7ad94098b4c8ea1293af92fcd8be9b5 | sys_template |      2 | config |             | url         | 2          |      -1 |       0 |         0 | _STRING   |       0 | https://example.org |
+----------------------------------+--------------+--------+--------+-------------+-------------+------------+---------+---------+-----------+-----------+---------+---------------------+

If TypoScript were parsed correctly, this should not happen.

(Not sure why URLs in TypoScript are added to reference index in the first place and whether this has any benefit).

No data to display

Also available in: Atom PDF