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

Update AbstractAdmin::hasSubject() in order to call AbstractAdmin::getSubject() to trigger the subject detection #4536

Closed
wants to merge 1 commit into from

Conversation

phansys
Copy link
Member

@phansys phansys commented Jul 1, 2017

I am targeting this branch, because AbstractAdmin::hasSubject() returns false since AbstractAdmin::$subject is not hydrated until AbstractAdmin::getSubject() is called.

Closes #4569

Changelog

### Fixed
- `AbstractAdmin::hasSubject()` returning `false` when `AbstractAdmin::$subject` isn't populated yet.

To do

  • Add tests in order to avoid regressions

…:getSubject()` to trigger the subject detection
@@ -1701,7 +1701,7 @@ public function getSubject()
*/
public function hasSubject()
{
return $this->subject != null;
return $this->getSubject() != null;
Copy link
Member

Choose a reason for hiding this comment

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

In this case, != null is not necessary. Am I right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Casting to boolean instead might be better, but this was not introduced by @phansys

@vyshkant
Copy link
Contributor

@phansys will you fix the tests? I will gladly do this, but I will need you to accept my PR on your branch.

@SonataCI
Copy link
Collaborator

Could you please rebase your PR and fix merge conflicts?

@OskarStark
Copy link
Member

@vyshkant I think you can create a new PR an reference this one

@vyshkant
Copy link
Contributor

vyshkant commented Nov 2, 2017

@OskarStark See #4738

@OskarStark
Copy link
Member

Closing in favor of #4738

@OskarStark OskarStark closed this Nov 3, 2017
@phansys phansys deleted the admin_has_subject branch March 6, 2020 20:51
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

6 participants