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

ISLANDORA-1647: New XSL self-transform to strip names without nameParts #264

Open
wants to merge 2 commits into
base: 7.x
Choose a base branch
from

Conversation

bondjimbond
Copy link
Contributor

@bondjimbond bondjimbond commented May 17, 2019

JIRA Ticket: (https://jira.duraspace.org/browse/ISLANDORA-1647)

What does this Pull Request do?

Adds a new XSL self-transform (just a copy of the islandora_cleanup_mods_extended.xsl with more code) that strips out elements that have either no <namePart> element or an empty <namePart/>.

This allows forms to prepopulate certain elements like roleTerm silently, but remove them if they're left empty (instead of creating useless <name> elements that contain nothing but a roleTerm).

What's new?

New XSL option is available for your form associations.

How should this be tested?

  • Ingest an object via a form, include details in the section but nothing in the <namePart>.
  • View the resulting MODS
  • Associate form with this XSLT and edit that object
  • The bad <name> and its child elements should be gone
  • In the same form, create some names that do have nameParts and view the MODS -- it should look normal.

Additional Notes:

I would really like to make this change simply part of the included islandora_cleanup_mods_extended.xsl file -- although I can see where folks might object. Can we perhaps discuss that here? If not, I'm happy enough to have the new option available.

Interested parties

@Islandora/7-x-1-x-committers @whikloj

@bondjimbond
Copy link
Contributor Author

I have started using this in production and have not yet seen any ill effects.

@whikloj whikloj self-assigned this Dec 20, 2019
@bondjimbond
Copy link
Contributor Author

@whikloj Ever have a chance to review this?

whikloj
whikloj previously approved these changes Feb 13, 2020
Copy link
Member

@whikloj whikloj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as described, but it does remove roleTerms if there is not a name associated. Because this is the destruction of user content I would not make this the default. But as a roleTerm without a name is not useful you might choose to remove it.

For instance

Test Default transform This transform
name exists, role term exists Left alone Left alone
name exists, role term doesn't Left alone Left alone
name doesn't exist, role term does Left alone Removed

@whikloj
Copy link
Member

whikloj commented Feb 13, 2020

Starting the 24 hour 🕐

@bondjimbond
Copy link
Contributor Author

@whikloj Can you test this with names that include <namePart type="given"> and <namePart type="family">? I'm noticing some weirdness with one of my forms (just one, not all of them) and wondering whether this transform is to blame.

@whikloj whikloj dismissed their stale review February 13, 2020 18:58

Mo' testing reveals mo' problems

@whikloj
Copy link
Member

whikloj commented Feb 13, 2020

@bondjimbond Ok, I modified the form to make two namePart fields. Added a bunch of names.

Surname Given name Role Result
Whiklo Jared Creator KEEP
Whiklo Jared KEEP
Whiklo Creator DELETE
Jared Creator DELETE
Whiklo DELETE
Jared DELETE
Creator DELETE

@bondjimbond
Copy link
Contributor Author

That's what I was afraid of. I wish I could remember how I came up with those lines in the first place.

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.

2 participants