-
Notifications
You must be signed in to change notification settings - Fork 29
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
IBX-6631: Enriched TrashItem
with removedLocationContentIdMap
#388
Conversation
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.
@barw4 this is very good, but as usual, I need some integration test coverage to see that those subtree IDs land there properly in that API TrashItem Value ;)
eZ/Publish/Core/Persistence/Legacy/Content/Location/Trash/Handler.php
Outdated
Show resolved
Hide resolved
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
/** | ||
* @return array<int, int> | ||
*/ | ||
public function getRemovedLocationContentIdMap(): array |
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.
In https://github.com/ezsystems/date-based-publisher/pull/267 I see that you are using this map to create content deletion notifications, and perform actual deletions.
Note that Content can have multiple locations, which means the same Content ID might occur in this map multiple times. Is this your intent?
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.
@Steveb-p Yes, it can appear multiple times. Why would that be a problem? If one schedule entry is deleted, the second one won't be found and hence, won't be deleted. No exception is being thrown.
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.
If that is the case, then it is ok. I assumed it was a case that was not taken into account and the same action was taken for the same Content ID more than once.
You may consider swapping the map order. By having it be array<ContentID, array<LocationID>>
(array with ContentID
as keys and an array of LocationID
s as value) you would have a similar effect, with Location IDs being grouped together. Only a suggestion though, of course.
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.
QA approved on IbexaDXP 3.3 commerce.
v3.3
Related PR: https://github.com/ezsystems/date-based-publisher/pull/267
One assert was removed because crucial values are compared in the same method which makes this assert obsolete. Obviously, it also fails as loaded
TrashItem
will always have an emptyremovedLocationContentIdMap
whether the one built after trashing - won't.Checklist:
$ composer fix-cs
).@ezsystems/engineering-team
).