Bug #83138
closedrte_ckeditor: Exception, if title-readOnly = true and no titleText is set
100%
Description
Hello together,
the following, own defined RTE-yaml:
buttons:
link:
page:
properties:
title:
readOnly: true
classesAnchor:
internalLink:
# No "titleText" is set
class: 'internalLink'
type: 'page'
(No "titleText" is set in classesAnchor.internalLink).
This leads to an exception:
htmlspecialchars() expects parameter 1 to be string, null given TypeError thrown in file /home/pbenke/Dokumente/Websites/www.allplan87.com/vendor/typo3/cms/typo3/sysext/rte_ckeditor/Classes/Controller/BrowseLinksController.php in line 472.
The same error, if I set titleText: ''
It only works, if titleText is set and not empty:
classesAnchor:
internalLink:
titleText: 'This is my default title'
class: 'internalLink'
type: 'page'
BTW:
It would be nice, if the title-field could be disabled at all.
There is the readOnly-option only.
Thank you.
Updated by Riccardo De Contardi over 6 years ago
- Status changed from New to Needs Feedback
Is this one still reproducible?
I tried the following test with both 8.7.17 and the latest master (9.4-dev):
1) Load the "default.yaml" CKEditor configuration
2) Append to it the configuration:
buttons: link: properties: class: allowedClasses: 'internalLink' page: properties: title: readOnly: true classesAnchor: internalLink: # No "titleText" is set class: 'internalLink' type: 'page'
3) Type a text inside the editor; select it and click the link button
Result:¶
- it is possible to select a page
- the title field in the link wizard is read-only
- it is possible to select the "internalLink" class
- the link is saved
- in frontend, the link works and the class "internalLink" is present
I've seen no error - is it sufficient to consider this issue closed or is there a different test that should be performed, or I missed something?
Thank you
Updated by Peter Benke over 6 years ago
Hi Riccardo,
thanks for your answer.
Yes, the problem still exists.
I could find the code, which causes the problem.
Your code is working:
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Default.yaml" }
buttons:
link:
properties:
class:
allowedClasses: 'internalLink'
page:
properties:
title:
readOnly: true
classesAnchor:
internalLink:
# No "titleText" is set
class: 'internalLink'
type: 'page'
But the following dies not work:
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Default.yaml" }
buttons:
link:
properties:
class:
allowedClasses: 'internalLink'
page:
properties:
########################################
class:
default: 'internalLink'
########################################
title:
readOnly: true
classesAnchor:
internalLink:
class: 'internalLink'
type: 'page'
The problem is the "class: ... default: 'internalLink'"
Thank you very much.
Updated by Riccardo De Contardi over 6 years ago
- Status changed from Needs Feedback to New
Updated by Riccardo De Contardi over 5 years ago
Still reproducible on 10.0.0-dev (latest master) with the code provided.
Updated by Gerrit Code Review over 4 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/c/Packages/TYPO3.CMS/+/63882
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/+/63882
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/+/63867
Updated by Daniel Goerz over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f2d0ccfee31bccb5a6bc510f0d4e517abeb2ac42.