-
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-6773: Bookmarks for non accessible contents cause exception #408
base: 1.3
Are you sure you want to change the base?
IBX-6773: Bookmarks for non accessible contents cause exception #408
Conversation
a15afa0
to
7246b2e
Compare
e2d1c9a
to
ddca556
Compare
eZ/Publish/API/Repository/Values/Content/Query/Criterion/IsBookmarked.php
Outdated
Show resolved
Hide resolved
.../Persistence/Legacy/Tests/Filter/CriterionQueryBuilder/Location/BookmarkQueryBuilderTest.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/Bookmark/Gateway/ExceptionConversion.php
Outdated
Show resolved
Hide resolved
eZ/Publish/Core/Persistence/Legacy/Bookmark/Gateway/ExceptionConversion.php
Outdated
Show resolved
Hide resolved
eZ/Publish/API/Repository/Values/Content/Query/SortClause/BookmarkId.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Paweł Niedzielski <[email protected]>
…n - removed covers
…n - Changed to ibexa namespace for new classes
…xception - Changed to ibexa namespace for new classes
…xception - Changed to ibexa namespace for new classes
…xception - changed deprecations messages
$expectedIdsAfter = array_map(static function (Location $item) use ($demoDesignLocationId, $contactUsLocationId) { | ||
if ($item->id === $demoDesignLocationId) { | ||
return $contactUsLocationId; | ||
} | ||
|
||
return $item->id; | ||
}, $beforeSwap->items); |
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.
Why is this mapping necessary? In particular, why is there a special case for $demoDesignLocationId
+ $contactUsLocationId
?
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.
The mapping is no longer needed. In first version of PR, I did not implement SortClause\BookmarkId
, so order of the result needed to be normalized.
I will revert the mapping.
I think the test is better when adding $contactUsLocation
. In original test we test the edge case where two bookmarked locations are swapped... In my version of the test, only one of the locations that are swapped are bookmarked.
Edit: Fixed cut&paste error that made the second paragraph meaningless
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.
Done in 8483861
ok?
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.
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.
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.
Quality Gate passedIssues Measures |
…n - Added logger in BookmarkService
…xception - Added logger in BookmarkService
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.
Please make sure the deprecated methods get removed on merging this up to main
.
src/contracts/Repository/Values/Content/Query/Criterion/IsBookmarked.php
Show resolved
Hide resolved
src/contracts/Repository/Values/Content/Query/Criterion/IsBookmarked.php
Outdated
Show resolved
Hide resolved
src/contracts/Repository/Values/Content/Query/Criterion/IsBookmarked.php
Outdated
Show resolved
Hide resolved
src/contracts/Repository/Values/Content/Query/SortClause/BookmarkId.php
Outdated
Show resolved
Hide resolved
src/contracts/Repository/Values/Content/Query/SortClause/BookmarkId.php
Outdated
Show resolved
Hide resolved
src/lib/Persistence/Legacy/Filter/SortClauseQueryBuilder/Bookmark/IdSortClauseQueryBuilder.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Paweł Niedzielski <[email protected]> Co-authored-by: Konrad Oboza <[email protected]>
Quality Gate passedIssues Measures |
v3.3
If user bookmark some location which he later looses access too, then the bookmark list in admin-ui fails with an exception.
Simply fixing
BookmarkService::loadBookmarks()
would be easy. The problem is to implementcountUserBookmarks()
in persistence layer and having it taking into account user permissions so that BC would be kept.Talked with Adam on how to solve this without breaking BC and he suggested implementing it using filtering
The Bookmark filter will only work with location filtering (
LocationService::find()
), not with content (ContentService::find()
)Checklist:
$ composer fix-cs
).@ezsystems/engineering-team
).