processmaker icon indicating copy to clipboard operation
processmaker copied to clipboard

Media Image/File Update with Persistent Folder IDs

Open marcoAntonioNina opened this issue 1 year ago • 0 comments

Issue & Reproduction Steps

The problem is the way in which the Tenants are created for PLG. There is a ProcessMaker installation that is used as a template, where the changes made are updated, once this update is made a Dump is made to the database and this Dump is used for the creation of the following Tenants.

The problem begins when the command php artisan processmaker:sync-guided-templates

is executed because this command synchronizes the templates and the images that it has.

Media library, which is the library that is used, does not perform an update of the files, it performs a deletion of the resource and creates a new one, therefore the MediaLibrary resource ID changes, which is detrimental to the creation flow of the Tenants for PLG.

Solution

  • Delete physical files from the MediaLibrary resource and then add only the file to the resource.

How to Test

use the command php artisan processmaker:sync-guided-templates

The IDs used for resource MediaLibrary used by templates shouldn't changed.

Related Tickets & Packages

Code Review Checklist

  • [ ] I have pulled this code locally and tested it on my instance, along with any associated packages.
  • [ ] This code adheres to ProcessMaker Coding Guidelines.
  • [ ] This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • [ ] This solution fixes the bug reported in the original ticket.
  • [ ] This solution does not alter the expected output of a component in a way that would break existing Processes.
  • [ ] This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • [ ] This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • [ ] This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • [ ] This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:next

marcoAntonioNina avatar Sep 25 '24 14:09 marcoAntonioNina