Skip to content

Commit

Permalink
FIX Row updating broken in SilverStripe 4 (#197)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
forsdahl committed Jun 28, 2022
1 parent ece0e20 commit d420a29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/BulkTools/HTTPBulkToolsResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function createBody()
);

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);
}
Expand Down

0 comments on commit d420a29

Please sign in to comment.