Bug #34872

Singleton validators never have their options passed

Added by Karsten Dambekalns over 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Must have
Assignee:
Category:
Validation
Start date:
2012-03-15
Due date:
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

The ValidatorResolver does not pass options to validators that are singletons:

            case Configuration::SCOPE_PROTOTYPE:
                $validator = new $validatorObjectName($validatorOptions);
                break;
            case Configuration::SCOPE_SINGLETON:
                $validator = $this->objectManager->get($validatorObjectName);
                break;

Since singletons cannot get constructor arguments via get() but only through object configuration, we should at least check for options given to a singleton here and inform the developer about a probably bug in his code…

#1

Updated by Karsten Dambekalns over 9 years ago

  • Target version changed from 1.0.4 to 1.0.5
#2

Updated by Karsten Dambekalns over 9 years ago

  • Target version changed from 1.0.5 to 1.1 RC1
#3

Updated by Karsten Dambekalns over 9 years ago

  • Status changed from Accepted to New
  • Assignee deleted (Karsten Dambekalns)
  • Target version deleted (1.1 RC1)
#4

Updated by Karsten Dambekalns almost 9 years ago

  • Subject changed from Singleton validators do not get their options to Singleton validators have never passed their options
#5

Updated by Karsten Dambekalns almost 9 years ago

  • Subject changed from Singleton validators have never passed their options to Singleton validators never have their options passed
#6

Updated by Adrian Föder almost 9 years ago

  • Status changed from New to Accepted
  • Assignee set to Adrian Föder
  • Target version set to 2.0
#7

Updated by Karsten Dambekalns almost 9 years ago

Why did you change the affected version?

#8

Updated by Gerrit Code Review almost 9 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17671

#9

Updated by Adrian Föder almost 9 years ago

sorry didn't want to change it but was used to click "git any" at that box, without reading a present value...

#10

Updated by Gerrit Code Review almost 9 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/17671

#11

Updated by Gerrit Code Review over 8 years ago

Patch set 1 for branch 2.0 has been pushed to the review server.
It is available at https://review.typo3.org/19562

#12

Updated by Adrian Föder over 8 years ago

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

Also available in: Atom PDF