You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value after page is saved: [no change to field value]
Working in both Silverstripe 4 and 5
Interestingly, if I create a test that explicitly sets a value to my field, then this correctly call my setter in both Silverstripe 4 and 5.
class PageTest extends SapphireTest
{
publicfunctiontestSetMyTestField(): void
{
$page = Page::create();
$page->MyTestField = 'Uppercase Words Here';
Debug::dump($page->MyTestField);
}
}
Output in both major versions:
====================================================
PageTest.php:16 - App\Tests\PageTest::testSetMyTestField()
uppercase words here
====================================================
Where saving values from formfields used to go through the full __set() pipeline, it's now only going through setField() which has caused this regression, since it's no longer checking for and subsequently calling the setter methods.
Affected Version
5.0.0-beta3
Description
Page
with a basic text fieldsetter
method for that fieldsetter
method(?)Is Silverstripe 4 it does, but in Silverstripe 5 it does not.
Set up
Page.php
:Silverstripe 4
Input value into field:
Value after page is saved:
Silverstripe 5
Input value into field:
Value after page is saved:
[no change to field value]
Working in both Silverstripe 4 and 5
Interestingly, if I create a test that explicitly sets a value to my field, then this correctly call my
setter
in both Silverstripe 4 and 5.Output in both major versions:
PRs
The text was updated successfully, but these errors were encountered: