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

Change property visibility to allow more flexibility for apps #19696

Merged
merged 5 commits into from
Nov 29, 2022

Conversation

lubosdz
Copy link
Contributor

@lubosdz lubosdz commented Nov 26, 2022

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues introduced by #18975, fixes #19696

Commit #18975 throws warning when reusing the View object more than once in a single request. This unfortunately ignores possible legit use cases. For example in one our app we have CMS admin, which requires in first step fetching & parsing View output from the page being edited (find placeholders) and then in returned view (2. View usage) display editable areas. Since 2.0.44 our logger is bloated with warnings You\'re trying to register a file after View::endBody() has been called. Since the property has been assigned private, there is no way to allow overriding behavior in an application e.g. for specific controllers only.

This commit alleviates aforementioned issue by changing property visibility from private to protected.

@what-the-diff
Copy link

what-the-diff bot commented Nov 26, 2022

  • The private property $_isPageEnded is changed to protected.
  • A warning message has been added in the registerFile() method when trying to add a file after View::endPage().

framework/web/View.php Outdated Show resolved Hide resolved
@samdark samdark added this to the 2.0.48 milestone Nov 27, 2022
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

Need a line for CHANGELOG.

@bizley bizley merged commit fe46b59 into yiisoft:master Nov 29, 2022
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.

None yet

4 participants