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.
GitHub Issue:
Other Relevant Links (Google Groups discussion, related pull requests,
Release pull requests, etc.)
What does this Pull Request do?
Forbids "normal" derivatives ("normal" i.e. create another media and attach it to my parent node) where the source and target media are the same media.
Example: I have a MP4 that is both my Original File and Service File. Before, i'd be stuck in an infinite loop of replacing the file with worse and worse versions of that video. Now, I know to leave it alone.
What's new?
AbstractGenerateDerivative checks and bails if the source media already has the destination term.
EmitEvent knows how to catch this exception
Trying to be good, I made a new "IslandoraDerivativeException".
Does this change add any new dependencies? no
Does this change require any other modifications to be made to the repository
(i.e. Regeneration activity, etc.)? no
Could this change impact execution of existing code? yes, in a desirable way.
How should this be tested?
With contexts set up to make service file derivatives, create some content, and a media which is (e.g. image) both Original File and Service File.
Notice messages in the logs about infinite versions of the media.
With this PR:
That doesn't happen. You should get one message in the logs that the derivative was not created.
Documentation Status
Additional Notes:
Any additional information that you think would be helpful when reviewing this
PR.
Interested parties
Tag (@ mention) interested parties or, if unsure, @Islandora/committers