Skip to content

[Validator] [Twig] added magic method __isset() to File Constraint class #24519

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

Closed
wants to merge 1 commit into from
Closed

[Validator] [Twig] added magic method __isset() to File Constraint class #24519

wants to merge 1 commit into from

Conversation

loru88
Copy link
Contributor

@loru88 loru88 commented Oct 11, 2017

Q A
Branch? 3.4 or master / 2.7, 2.8 or 3.3
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #24512
License MIT
Doc PR symfony/symfony-docs#...

In my project I get assert constraints from one of my entity and I use this value in my front end via Twig.
I faced a problem with the property $maxSize of the File Constraint.

As this property is protected I cannot access it via Twig because the magic method __isset is missing, as I read in twig documentation.

@nicolas-grekas
Copy link
Member

Can you rebase and retarget your PR for 3.4? (+ update the CHANGELOG)

@nicolas-grekas nicolas-grekas added this to the 3.4 milestone Oct 12, 2017
@nicolas-grekas nicolas-grekas changed the base branch from master to 3.4 October 12, 2017 16:09
@fabpot
Copy link
Member

fabpot commented Oct 12, 2017

Sounds like a bug to me though. __get() is not implemented the right way if __isset() is not implemented.

Copy link
Member

@xabbuh xabbuh left a comment

Choose a reason for hiding this comment

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

as a bugfix on 2.7

@fabpot
Copy link
Member

fabpot commented Oct 12, 2017

Thank you @loru88.

fabpot added a commit that referenced this pull request Oct 12, 2017
…nstraint class (loru88)

This PR was submitted for the 3.4 branch but it was merged into the 2.7 branch instead (closes #24519).

Discussion
----------

[Validator] [Twig] added magic method __isset()  to File Constraint class

| Q             | A
| ------------- | ---
| Branch?       | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
| Bug fix?      | no
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->
| Tests pass?   | yes
| Fixed tickets | #24512  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->

In my project I get assert constraints from one of my entity and I use this value in my front end via Twig.
I faced a problem with the property $maxSize of the File Constraint.

As this property is protected I cannot access it via Twig because the magic method __isset is missing, as I read in twig documentation.
<!--
- Bug fixes must be submitted against the lowest branch where they apply
  (lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against the 3.4,
  legacy code removals go to the master branch.
- Please fill in this template according to the PR you're about to submit.
- Replace this comment by a description of what your PR is solving.
-->

Commits
-------

9efb765 [Validator] added magic method __isset()  to File Constraint class
@fabpot
Copy link
Member

fabpot commented Oct 12, 2017

merged into 2.7.

@fabpot fabpot closed this Oct 12, 2017
@loru88
Copy link
Contributor Author

loru88 commented Oct 13, 2017

your 're welcome @fabpot, sorry to not have merged into 2.7

This was referenced Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants