[IMGPLACE-1] Placement count is not removed if image is not used anymore Created: 29/Mar/22  Updated: 18/Jan/24  Resolved: 18/Jan/24

Status: Closed
Project: Image Placement
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Bug Priority: Major
Reporter: Tobias Kerschbaum Assignee: Raphael Falvo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Steps to reproduce:

  1. Add Image
  2. Use image in a page
  3. Run groovy script
  4. remove image from the page
  5. Run groovy script again

Expected result:

Placement count should be 0

Actual result:

Placement count is still 1



 Comments   
Comment by Markus Schwarz [ 01/Apr/22 ]

I did some research here and can't see how we can fix that with the current magnolia architecture.

When we delete things, we were notified afterwards but couldn't get any information about what was deleted, because the event didn't provide additional information on this.

And as we have no versioning on the author level, there is also no way to retrieve this information somewhere else.

So the code gets stuck here => https://git.magnolia-cms.com/projects/SERVICES/repos/image-placement/browse/src/main/java/info/magnolia/dam/imageplacement/location/CheckImagePlacement.java#77

and couldn't fetch any information about the image references that were deleted.

Comment by Markus Schwarz [ 01/Apr/22 ]

The adobe folks solve this with workflows (https://stackoverflow.com/questions/60450795/how-to-read-a-jcr-nodes-properties-before-its-deleted-in-adobe-experience-mana) but I don't think that this is the solution here.

Comment by Raphael Falvo [ 18/Jan/24 ]

Fixed in release 2.0

Generated at Mon Feb 12 02:07:57 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.