Project

General

Profile

Actions

Bug #83138

closed

rte_ckeditor: Exception, if title-readOnly = true and no titleText is set

Added by Peter Benke over 6 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2017-11-28
Due date:
% Done:

100%

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

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.

Actions #1

Updated by Riccardo De Contardi almost 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

Actions #2

Updated by Peter Benke almost 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.

Actions #3

Updated by Riccardo De Contardi almost 6 years ago

  • Status changed from Needs Feedback to New
Actions #4

Updated by Riccardo De Contardi about 5 years ago

Still reproducible on 10.0.0-dev (latest master) with the code provided.

Actions #5

Updated by Gerrit Code Review about 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

Actions #6

Updated by Gerrit Code Review about 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

Actions #7

Updated by Gerrit Code Review about 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

Actions #8

Updated by Daniel Goerz about 4 years ago

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

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF