Repository navigation
Conversation
simahawk
force-pushed
the
18-fix-media-replace-active
branch
from
October 1, 2026 19:20
da7937e to
75201ca
Compare
Was mispelled and not really meaningful.
Avoid full break with corrupted files, just log an error.
Add 'keep_history' and 'keep_relations' options to the replace wizard, with the shared logic to copy and archive the record owning the replaced file, and hooks to handle its relations. Provide a base form for the wizard, to extend by the modules defining the records owning files. Without 'keep_history', the replaced file is dropped: nothing refers to it anymore. The copy reuses the old file and its backend: otherwise the creation writes the default backend on the reused file, which moves it.
Use the shared replace logic from storage_file and extend its wizard form. Drop the explicit '_inverse_data' call: creating the file with its data already stores it on the backend.
Use the shared replace logic from storage_file and extend its wizard form.
On file replacement, copy the product relations and the categories of the media to its archived copy when 'keep_relations' is set.
On file replacement, copy the product and category relations of the image to its archived copy when 'keep_relations' is set.
simahawk
force-pushed
the
18-fix-media-replace-active
branch
from
October 2, 2026 12:48
75201ca to
cc126cb
Compare
simahawk
marked this pull request as ready for review
October 6, 2026 11:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace file wizard: optionally keep the replaced file as history
The storage_file replace wizard can now keep an archived copy of the record that owns the replaced file (
keep_history), linked to the same records (keep_relations).The other modules are adapted to use it. See the commits for details.