-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Component/s: Collections
-
Tags:
-
Sprint:nxfit 9.1.2
-
Story Points:3
This was detected by NXMOB-238: the document returned by the Document.AddToFavorites operation was showing false for the isFavorite enricher although it had actually been added as a Favorite.
This was due to the use of a temporary DocumentModel in
CollectionManagerImpl#addToCollection(final DocumentModel collection, final DocumentModel documentToBeAdded, final CoreSession session)
that forced the need to re-fetch the document from the session once added to a collection to get a fresh state, which was done in the tests, but not in Document.AddToFavorites:
public DocumentModel run(DocumentModel doc) { favoritesManager.addToFavorites(doc, session); return doc; }
The fix allows to remove these extra doc = session.getDocument(doc.getRef()) calls from the tests.
Note that the problem didn't happen when removing a document from a collection because there is no such use of a temporary DocumentModel in
CollectionManagerImpl#doRemoveFromCollection(DocumentModel documentToBeRemoved, String collectionId, CoreSession session)
- is required by
-
NXMOB-238 Sliding action "add to Favorites" can be done twice
- Resolved