Bug #67794

Wrong validation of select fields in Backend

Added by Silvia Bigler over 6 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Backend User Interface
Target version:
Start date:
2015-06-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Remote Sprint

Description

After I updated my typo3 to 7.4-dev I can't choose the Backend layout field anymore.
I still can select the entries with id 0 and 1, but not anything above uid 1, it will prevent the form from saving.

I tracked the issue down to here: typo3/sysext/backend/Resources/Public/JavaScript/FormEngineValidation.js Line 91.
It will check minItems and maxItems and validate it against the item uid instead of the item count.

I solved it on my plattform with replacing
if (selected < rule.minItems || selected > rule.maxItems) {

with

if (selected.length < rule.minItems || selected.length > rule.maxItems) {

This was introduced on 3. May with 74d875c4fb3044ceff98549b8014391bc37506dd

#1

Updated by Silvia Bigler over 6 years ago

I just discovered that my original change was just rubbish -.-

Something like

var selected = $field.find('option:selected').length;
if (selected < rule.minItems || selected > rule.maxItems) {

should be better. But I doubt that this would also work for the range fields, because they are handled with the same code.

#2

Updated by Frank Naegler over 6 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Frank Naegler
  • Target version set to 7.4 (Backend)
  • Sprint Focus set to Remote Sprint

Can't reproduce the problem. Can you give me some more information about your System? Browser and Version?

#3

Updated by Frank Naegler over 6 years ago

  • Status changed from Needs Feedback to Accepted

ok, get the problem. I will take care of a patch

#4

Updated by Gerrit Code Review over 6 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 http://review.typo3.org/40703

#5

Updated by Silvia Bigler over 6 years ago

Thanks for this very fast reaction! Nice Work!

#6

Updated by Frank Naegler over 6 years ago

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

Updated by Riccardo De Contardi about 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF