-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API Make validator param nullable #11512
API Make validator param nullable #11512
Conversation
8cce5b7
to
bfe6f94
Compare
@@ -303,9 +303,9 @@ public function testTreeSearchUsingSubObject() | |||
$cssPath = 'ul.tree li#selector-TestTree-' . $subObject1->ID . ' li#selector-TestTree-' . $subObject1ChildB->ID . ' a'; | |||
$firstResult = $parser->getBySelector($cssPath); | |||
$this->assertEquals( | |||
$subObject1ChildB->Name, | |||
$subObject1ChildB->Title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test used to pass by accident. The fixtures in TreeDropdownFieldTest.yml have a Title property, not a Name property
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting to know what we changed that stopped that from working, but you're right that it shouldn't have been.
* @return $this | ||
*/ | ||
public function setValidator(Validator $validator) | ||
public function setValidator(?Validator $validator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to have this param nullable, as there is no default and you should be able to 'unset' any existing validators, as there is no longer a need to always have a validator now that the Form will loop form fields and call validate() on them
Issue silverstripe/.github#349
Two commits
API commit Fixes
TypeError: SilverStripe\Forms\Form::setValidator(): Argument 1 ($validator) must be of type SilverStripe\Forms\Validation\Validator, null given, called in /home/runner/work/silverstripe-installer/silverstripe-installer/vendor/silverstripe/framework/tests/php/Forms/GridField/GridFieldTest.php on line 554
MNT commit fixes
The data provider specified for SilverStripe\Forms\Tests\DropdownFieldTest::testGetDefaultValue is invalid
Data Provider method SilverStripe\Forms\Tests\DropdownFieldTest::provideGetDefaultValue() is not static
and
is found, nested under
Failed asserting that 'Child B of Four SubObject' matches expected null.