FIX Row updating broken in SilverStripe 4 (#197)

Row updating is broken in SilverStripe 4 when for example using the PublishHandler or UnPublishHandler actions. This is due to unescaped backslashes in the fully qualified class name in json data, which when parsed in javascript treats the backslash as an escape character.
This can be fixed by escaping the backslash character in HTTPBulkToolsResponse.
This commit is contained in:
Niklas Forsdahl 2022-06-28 05:51:05 +03:00 committed by GitHub
parent ece0e209ef
commit d420a29e9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -334,7 +334,7 @@ class HTTPBulkToolsResponse extends HTTPResponse
);
foreach ($this->successRecords as $record) {
$data = array('id' => $record->ID, 'class' => $record->ClassName);
$data = array('id' => $record->ID, 'class' => str_replace('\\', '\\\\', $record->ClassName));
if (!$this->removesRows) {
$data['row'] = $this->getRecordGridfieldRow($record);
}