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
When restoring an archived Elemental block, as shown in the screenshot below, an error occurs due to invalid argument passed to the 2nd parameter of redirect function. Instead if an int a string is passed, hence the redirection did not work to the target page.
How to reproduce
The method, doRestore of ArchivedRestoreAction class is calling redirect method of the controller but passing a string as the 2nd argument. This is now incorrect due to PHP 8.2 strict typing applied to CMS 5.1 hence creating an error.
Line 92: return $controller->redirect($controller->Link(), 'index');
Possible Solution
The fix should be to remove the 2nd argument since index is default behaviour.
Line 92: return $controller->redirect($controller->Link());
Additional Context
No response
Validations
Check that there isn't already an issue that reports the same bug
Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Acceptance criteria
No errors are thrown when restoring a Page or Content block.
Restoration of page or content block is covered by some PHPunit test and at least some Behat test.
Module version(s) affected
2.1.2
Description
When restoring an archived Elemental block, as shown in the screenshot below, an error occurs due to invalid argument passed to the 2nd parameter of
redirect
function. Instead if anint
astring
is passed, hence the redirection did not work to the target page.How to reproduce
The method,
doRestore
ofArchivedRestoreAction
class is callingredirect
method of the controller but passing a string as the 2nd argument. This is now incorrect due to PHP 8.2 strict typing applied to CMS 5.1 hence creating an error.Line 92:
return $controller->redirect($controller->Link(), 'index');
Possible Solution
The fix should be to remove the 2nd argument since
index
is default behaviour.Line 92:
return $controller->redirect($controller->Link());
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)Acceptance criteria
PRs
The text was updated successfully, but these errors were encountered: