Bug #87031

colorpicker : pasted value is saved in database without formating/checking

Added by Filipe DA COSTA COSTA 5 months ago. Updated 25 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2018-11-28
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If you paste a value into a colorpicker, some formating seems to be done but in reallity the raw value is saved in database.

A) Color missing hash (See attached Typo3ColorpickerIssueColor.gif)

  • Copy "00FF00"
  • Paste the value into colorpicker
  • Blur out of the input

The input value will visually change to "#00ff00".

  • Save page

The colorpicker displays "00FF00".

B) Random value (See attached Typo3ColorpickerIssue.gif)

  • Copy "NOT_A_COLOR"
  • Paste the value into colorpicker
  • Blur out of the input

The input value will visually be blank. If you have a "eval => required" you will notice that the red error will disappear.

  • Save page

The colorpicker displays "NOT_A_COLOR".

TCA configuration used for this example:

 'tx_apxsample_color' => [
        'exclude' => 1,
        'label'   => 'Color Hex Code',
        'config'  => [
            'type'       => 'input',
            'renderType' => 'colorpicker',
            'size'       => 10,
            'eval'       => 'required'
        ]
    ]

Typo3ColorpickerIssue.gif View (450 KB) Filipe DA COSTA COSTA, 2018-11-28 18:13

Typo3ColorpickerIssueColor.gif View (509 KB) Filipe DA COSTA COSTA, 2018-11-28 18:13

Associated revisions

Revision 36223868 (diff)
Added by Filipe DA COSTA COSTA 26 days ago

[BUGFIX] Update ColorPicker to use cleaned minicolors hex value

Force ColorPicker to use the formatted/cleaned value jQuery's minicolors
produces instead of just displaying it but still saving the raw value
the user inputs.

Resolves: #87031
Releases: master, 9.5
Change-Id: I49d9f094961137ae50561475d5421f536b705c70
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59052
Tested-by: TYPO3com <>
Tested-by: Henrik Elsner <>
Tested-by: Daniel Goerz <>
Reviewed-by: Henrik Elsner <>
Reviewed-by: Daniel Goerz <>

Revision d1c88077 (diff)
Added by Filipe DA COSTA COSTA 25 days ago

[BUGFIX] Update ColorPicker to use cleaned minicolors hex value

Force ColorPicker to use the formatted/cleaned value jQuery's minicolors
produces instead of just displaying it but still saving the raw value
the user inputs.

Resolves: #87031
Releases: master, 9.5
Change-Id: I49d9f094961137ae50561475d5421f536b705c70
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/60344
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Reviewed-by: Daniel Goerz <>

History

#1 Updated by Filipe DA COSTA COSTA 5 months ago

Adding the missing attachments

#2 Updated by Gerrit Code Review 4 months 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/59052

#3 Updated by Gerrit Code Review 4 months 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/59052

#4 Updated by Gerrit Code Review 4 months 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/59052

#5 Updated by Gerrit Code Review 27 days 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/+/59052

#6 Updated by Gerrit Code Review 26 days 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/+/60344

#7 Updated by Filipe DA COSTA COSTA 25 days ago

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

Also available in: Atom PDF