Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Update ArchiveRestoreAction::doRestore() method to pass correct argument in redirection function #331

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

ssmarco
Copy link

@ssmarco ssmarco commented Mar 10, 2024

Description

The redirect function inside doRestore() is not compatible to PHP 8.2 with strict argument types. Fixes parameter passed into redirect function.

This only affects CMS 5 due to PHP 8.2 strict type checks and not CMS 4

Manual testing steps

  1. Install Elemental blocks in your CMS
  2. Create page
  3. Add an elemental block to the page and publish it
  4. Publish the page
  5. Go back to the elemental block and archive it
  6. Go to the Archive section of the CMS
  7. Activate the Blocks tab
  8. Open the record of the elemental block previously from the Gridfield
  9. Click Restore to draft button
  10. Expected outcome, will be a success message but an error messages shows instead
  11. Refer to the issue submitted below

Issues

Pull request checklist

  • The target branch is correct
  • All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
    • Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
  • The commit messages follow our commit message guidelines
  • The PR follows our contribution guidelines
  • Code changes follow our coding conventions
  • This change is covered with tests (or tests aren't necessary for this change)
  • Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
  • CI is green

@ssmarco ssmarco marked this pull request as ready for review March 10, 2024 07:02
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GuySartorelli
Copy link
Member

GuySartorelli commented Mar 11, 2024

Looks good, thanks!
Please retarget this to either the 2.1 branch if it only affects CMS 5.x, or the 1.13 branch if it also affects CMS 4.
That way it can be released as a patch instead of waiting for the October minor release.

You may need to reset your commits after retargetting it.

@ssmarco
Copy link
Author

ssmarco commented Mar 11, 2024

You may need to reset your commits after retargetting it.

Thanks have reset the commit and target the correct branch

…rgument in redirection

This only affects CMS 5 and not CMS 4
The redirect function inside `doRestore()` is not compatible to PHP 8.2 with strict argument types.
Fixes parameter passed into redirect function.
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this.

@GuySartorelli GuySartorelli merged commit 450979c into silverstripe:2.1 Mar 12, 2024
12 checks passed
@ssmarco ssmarco deleted the patch-1 branch March 12, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants