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

Remove leftover code in the DataContainer class #5121

Merged
merged 2 commits into from Aug 12, 2022

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Aug 11, 2022

Fixes #4969

DataContainer::row uses $this->User->isAdmin on form submit - however at this stage the BackendUser instance is not imported yet.

@fritzmg fritzmg added the bug label Aug 11, 2022
@fritzmg fritzmg added this to the 4.9 milestone Aug 11, 2022
@fritzmg fritzmg self-assigned this Aug 11, 2022
@aschempp
Copy link
Member

aschempp commented Aug 11, 2022

might also fix this by using security voters on ROLE_ADMIN 🙃

@leofeyer leofeyer linked an issue Aug 11, 2022 that may be closed by this pull request
@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 11, 2022

Yes, I just opted for the more minimal fix. I also wonder whether this has any unintended side-effects. Clearly this bit of code was never executed 😁

@fritzmg
Copy link
Contributor Author

fritzmg commented Aug 11, 2022

As discussed on Slack the adjustments to $newPaletteFields aren't actually necessary, so we can remove that and the $this->User->isAdmin check altogether.

@fritzmg fritzmg requested a review from leofeyer August 11, 2022 15:08
@leofeyer leofeyer changed the title Add missing BackendUser import Remove leftover code in the DataContainer class Aug 12, 2022
@leofeyer leofeyer merged commit 967eb4b into contao:4.9 Aug 12, 2022
@leofeyer
Copy link
Member

Thank you @fritzmg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 8 warning in editAll mode in DC_Folder
4 participants