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

Check the attribute type the BackendAccessVoter::supports() method #1013

Merged
merged 4 commits into from
Nov 27, 2019
Merged

Check the attribute type the BackendAccessVoter::supports() method #1013

merged 4 commits into from
Nov 27, 2019

Conversation

AndreasA
Copy link
Contributor

@AndreasA AndreasA commented Nov 23, 2019

Ensure that the e.g. ExpressionLanguage objects are ignored when checking for support in the BackendAccessVoter.

Fixes: contao/core-bundle#1710

See also previous PR (and the discussions) for core-bundle: contao/core-bundle#1711

Even if it is a bug in Symfony in the end, I think we should still add the check (at least until we have to update the Access Voter anyway to include the missing type hinting.

@AndreasA
Copy link
Contributor Author

@Toflar The tests all seem to fail here because of the DebugClassLoader used in \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::__construct. I removed the Legacy option there in the code and aftewards the new test worked fine locally - and as I only added one it shouldn't impact the others anyway.

@AndreasA AndreasA closed this Nov 23, 2019
@AndreasA AndreasA reopened this Nov 23, 2019
aschempp
aschempp previously approved these changes Nov 26, 2019
Copy link
Member

@aschempp aschempp left a comment

Choose a reason for hiding this comment

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

I agree with fixing this, it does not harm and might upstream-fix Symfony for now

@leofeyer leofeyer added the bug label Nov 26, 2019
@leofeyer leofeyer added this to the 4.9 milestone Nov 26, 2019
@leofeyer
Copy link
Member

@AndreasA Thank you for your pull request. Can you please rebase it onto the latest master branch? This should fix the CI issues.

@AndreasA
Copy link
Contributor Author

Rebased to latest master and now pipelines succeeded.

@leofeyer leofeyer changed the title BUGFIX: BackendAccessVoter ensure string when checking for supported attribute BackendAccessVoter ensure string when checking for supported attribute Nov 27, 2019
@leofeyer leofeyer merged commit 3af03a2 into contao:master Nov 27, 2019
@leofeyer
Copy link
Member

Thank you @AndreasA.

@leofeyer leofeyer changed the title BackendAccessVoter ensure string when checking for supported attribute Check the attribute type the BackendAccessVoter::supports() method Aug 10, 2020
@leofeyer leofeyer changed the title Check the attribute type the BackendAccessVoter::supports() method Check the attribute type the BackendAccessVoter::supports() method Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants