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
After merging Validation of fields when inline saving looks like we're unable to consistently to inline save related data fields on custom blocks such as TreedropdownField and UploadField.
This will also affect the ability to inline clear a related field that currently has a value
When using the regular page save things seem to work correctly when using auto-scaffolded fields
TreedropdownField
Auto-scaffolded field with an 'ID' suffix will xhr POST:
Removing the suffixes will not xhr POST data for the Treedropdown field at all resulting in a 200, and field will just clear itself when the react component re-renders because the database value was never updated
UploadField
Auto-scaffolded field without in an 'ID' suffix will xhr POST:
PageElements_4_MyFile[Files][0] "2"
Which results in a 200, but database isn't updated
Adding the suffix will xhr POST
PageElements_4_MyFileID[Files][0] "2"
Which results in a 500
// app/src/MyBlock;useDNADesign\Elemental\Models\BaseElement;
class MyBlock extends BaseElement
{
privatestatic$has_one = [
'MyPage' => SiteTree::class,
'MyFile' => File::class,
];
publicfunctiongetCMSFields()
{
$fields = parent::getCMSFields();
// remove auto-scaffolded field with an ID suffix and add in field without ID suffix$fields->removeByName('MyPageID');
$fields->addFieldToTab('Root.Main', TreeDropdownField::create('MyPage', 'My Page', SiteTree::class));
// remove auto-scaffolded field without an ID suffix and add in a field with an ID suffix$fields->removeByName('MyFileID');
$fields->addFieldToTab('Root.Main', UploadField::create('MyFileID', 'My File')->setIsMultiUpload(false));
return$fields;
}
}
After merging Validation of fields when inline saving looks like we're unable to consistently to inline save related data fields on custom blocks such as TreedropdownField and UploadField.
This will also affect the ability to inline clear a related field that currently has a value
When using the regular page save things seem to work correctly when using auto-scaffolded fields
TreedropdownField
Auto-scaffolded field with an 'ID' suffix will xhr POST:
Which will result in a 500
Removing the suffixes will not xhr POST data for the Treedropdown field at all resulting in a 200, and field will just clear itself when the react component re-renders because the database value was never updated
UploadField
Auto-scaffolded field without in an 'ID' suffix will xhr POST:
Which results in a 200, but database isn't updated
Adding the suffix will xhr POST
Which results in a 500
PRs
The text was updated successfully, but these errors were encountered: