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

Prevent deprecation notice when AdminInterface.isCurrentChild is implemented #6429

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

jorrit
Copy link
Contributor

@jorrit jorrit commented Sep 29, 2020

Subject

Even when a child admin instance implements the isCurrentChild() method, getCurrentChildAdmin() will try to call the deprecated method getCurrentChild() anyway, causing this deprecation notice:

User Deprecated: The Sonata\AdminBundle\Admin\AbstractAdmin::getCurrentChild() method is deprecated since version 3.65 and will be removed in 4.0. Use Sonata\AdminBundle\Admin\AbstractAdmin::isCurrentChild() instead.

I changed the code such that getCurrentChildAdmin() only calls getCurrentChild() when isCurrentChild() is not implemented.

I am targeting this branch, because it's a backwards compatible improvement.

Changelog

### Fixed
- Superfluous deprecation notice in `getCurrentChild()` when calling `getCurrentChildAdmin()`.

@jordisala1991 jordisala1991 merged commit f5e4926 into sonata-project:3.x Sep 29, 2020
@jordisala1991
Copy link
Member

Thank you @jorrit

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.

3 participants