Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning #733

Merged
merged 15 commits into from
Nov 12, 2019
Merged

Versioning #733

merged 15 commits into from
Nov 12, 2019

Conversation

dannylamb
Copy link

All work done by @elizoller. Can't take any credit on this one. I just migrated this PR over from Islandora/documentation#154

GitHub Issue: Related to: (Islandora/documentation#740)

What does this Pull Request do?

  • Allows versioning of an object to be initiated from Drupal node updates

What's new?

  • Adds a context action create_node_version_in_fedora which can be added to a context reaction.
  • Adds the event type to the event object being passed to Alpaca
  • Adds a "Version" event type
  • This change could be added to the index "reaction" in the repository item context by default and/or added to documentation that this is how one "enables" versioning on a node

How should this be tested?

  • pull in the PR to your islandora modules - uninstall/re-enable islandora_core_feature
  • add the "Create Node Version in Fedora" to the "Index" reaction in the repository_content context
  • make sure that the "Version" event gets fired on node_update (could probably just run a debug)
  • make sure that the event type is included in the emitted event object (could debug from EventGenerator or update an alpaca feature to try this)

Additional Notes:

One important note is that using the IndexReaction for triggering the create_node_version_in_fedora means that the event is triggered as part of islandora_node_insert and islandora_node_update (i think...). Having it be part of node_update means that the version is created before the node is updated.
Another way to do this is to use a new reaction (maybe called VersionReaction) that could then be included in any hooks in islandora.module although probably islandora_node_update makes the most sense.

Interested parties

@Islandora-CLAW/committers

@elizoller
Copy link
Member

I can't edit this PR, but an update on the instructions:
You just need to pull down this PR as your islandora module, there is no configuration necessary as the versioning is fired automatically on node by the EventGenerator on bundles which are versionable and return true with shouldCreateNewRevision

@seth-shaw-unlv
Copy link

seth-shaw-unlv commented Nov 7, 2019

@elizoller build failed due to a coding standard issue. (It is grumbling about that commented out logger line being too long.)

src/EventGenerator/EventGenerator.php Outdated Show resolved Hide resolved
src/EventGenerator/EventGenerator.php Outdated Show resolved Hide resolved
src/EventGenerator/EventGenerator.php Outdated Show resolved Hide resolved
…heck for not being a generate derivative message
@seth-shaw-unlv
Copy link

This looks good; but I'll hold off on merging until the related PRs are green.

@seth-shaw-unlv seth-shaw-unlv merged commit 00b9006 into 8.x-1.x Nov 12, 2019
@seth-shaw-unlv seth-shaw-unlv deleted the versioning branch November 12, 2019 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants