-
Notifications
You must be signed in to change notification settings - Fork 19
IBX-11038: Content rendering in BO fails after deleting user that created the content #1796
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
base: main
Are you sure you want to change the base?
Conversation
|
| { | ||
| $parameters['creator'] = null; | ||
| $ownerId = $contentInfo->getOwner()->getUserId(); | ||
| $ownerId = $contentInfo->ownerId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you figure out why is it different than getOwner()->getUserId()? We avoid magic whenever possible and that was also the intention behind this change. //POV ping @alongosz.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I didn't dig too deep, just saw we have used $contentInfo->ownerId and we don't have a getter for the ownerId either so I have just reverted to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This supposed to be an equivalent, that's why I ask. I will let Andrew give his cents though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we even put userId for deleted user here? I would say that we should revert back to getOwner() (its probably not populated due to missing user object, and ownerId is just int thats still stored in db) and just handle gracefully not existing user.
Does that alsmo kmeans that typehint at \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo::$owner
protected User $owner;
is wrong?
|
|
Since playing around initializing the lazy proxy didn't quite work out I decided to use try catch for the problematic user |



Description:
This is a regression coming from #1697
authorinVersionInfomust be nullable so we can still display content of some deleted user.I have also reverted in
AuthorsTabretrievingownerIdto be directly accessed fromcontentInfoinstead of quering the owner as it might be no longer in the database.