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

Fix migration for resource type terms; Linked Agent field defaults to "No relation" option #50

Merged
merged 6 commits into from
Apr 21, 2021

Conversation

kspurgin
Copy link
Contributor

GitHub Issue: Islandora/documentation#1531, Islandora/documentation#1770

  • Other Relevant Links (Google Groups discussion, related pull requests,
    Release pull requests, etc.)
    na

What does this Pull Request do?

What's new?

  • Updates default tags migration so that the value of the external_uri field in the tags CSV will be ingested into field_authority_link if a vocabulary (such as Resource Types) uses this field instead of field_authority_link. This change was suggested by @kayakr here

  • Updates field_linked_agent config to...

    • make relators:asn with an empty string display value the first (i.e. de-facto default) value in the rel_types list
    • remove relators:asn|Associated name from the rel_types list because it caused a duplicate key error.
    • remove relator codes and other parenthetical info from display values of all terms
  • Does this change require documentation to be updated?

I think it would be best to note in the documentation for this field that the default values that ship include the following deprecated terms:

'relators:clb': 'Collaborator (clb; deprecated, use Contributor)'
'relators:grt': 'Graphic technician (grt; deprecated, use Artist)'
'relators:voc': 'Vocalist (voc; deprecated, use Singer)'

In stripping out the parenthetical info in the display values, we removed any indication of the fact that these terms are deprecated. Some institutions may want to remove them from the list or re-add the deprecated/use note, depending on their needs.

  • Does this change add any new dependencies? Yes, @seth-shaw-unlv is making some changes to the Typed Relation field type in controlled_access_terms that are related to the changes made to field_linked_agent

  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? Not sure/don't think so

  • Could this change impact execution of existing code? Not sure/don't think so.

How should this be tested?

Sorry these are going to be vague...

the migration part (1531)
I was not able to test this in our development environment because it is rebuilding from configs instead of actually starting from scratch and using the islandora_defaults code. Further, Nigel has disabled the migration from being picked up in our instances because it was causing a problem for something else (?), so I couldn't manually run it.

I believe to test the migration part you will need to spin up a brand new Islandora completely from scratch. Or do something clever to get the migration config into an existing instance and manually run it.

After the migration runs, examine a term in the Resource Types vocabulary and ensure the authority link from the tags CSV has been imported into the Authority Link field.

the field config part (1770)
I was able to test this by doing drush config:import --partial --source PATH/TO/ISLANDORA_DEFAULTS/CONFIG/INSTALL on a branch in our dev environment

For me, this command got one error or warning unrelated to changes made here: apparently the field type of field_description changed at some point and now there's data in the field so it's a problem. If you see this, just ignore it.

Steps to test:

  1. Create a new Repository Item and look at the Linked Agent field in the form.
  2. Verify that nothing is initially showing in the Relationship Type dropdown (i.e. the default is now "no relation")
  3. Choose a relationship type value from the list, verifying that it just says "Author" rather than "Author (aut)"

To test further, I think there is a dependency on further work @seth-shaw-unlv is doing on formatter/display for the Typed Relation field type in controlled_access_terms

Additional Notes:

Not thinking of anything, other than next time I'm going to make two separate PRs for two separate issues instead of combining them like this. Seemed like it was going to be easier and Seth said it was fine, but it's bugging me :-)

Interested parties (not already tagged)

@mjordan @rosiel @dannylamb

Keep the first one (with blank display value) because that is the
point of Islandora/documentation#1770. Remove the second one
because it caused a duplicate key error.
Though the Resource Types vocabulary has been updated to use the
Authority Link field type, the machine name of the field is still
field_external_authority_link.
@elizoller
Copy link
Member

is there/should there be an update hook for this?

@kspurgin
Copy link
Contributor Author

@elizoller Maybe? Don't know. An update hook was not mentioned in either of the issues I was looking at, or I wouldn't have taken them on as that's beyond what I know how to do at this point.

Isn't there an existing assumption that islandora_defaults is ever just going to be installed once, initially? Which seems to suggest no need for an update hook (unless I'm wrong about what that is).

I think I remember hearing discussion about whether we wanted to make it so people with existing installations could update defaults and get the new stuff (and I think that's probably a good idea if it can happen without messing up any customizations they've done), but I think it's a separate issue.

@elizoller
Copy link
Member

right... i guess i'm just still slightly confused with islandora_defaults because it becomes a dependency if you use the fields from it...which is what we have going on.

@kspurgin
Copy link
Contributor Author

It's confusing that you get some version of it from some point in time and can't update it.

I got messed up for a minute because I was working in a sandbox that Danny spun up two days ago and the machine name of the authority link field in Resource Types is field_external_authority_link even though the change to controlled_access_terms making that field_authority_link was merged in May 2020.

Which I don't even know if that is a related thing, but it's all part of my big blob of confusion about how the pieces work together

Copy link
Member

@elizoller elizoller left a comment

Choose a reason for hiding this comment

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

i have a vanilla d9 islandora setup and i grabbed these two configs and did a config import partial with both of them.
for the migration config-

  • originally resource types did not have the URIs in the field_authority_link
  • after config import, i ran migrate:import with update like drush migrate:import --userid=1 --uri=http://localhost:8000 --update islandora_defaults_tags
  • now the resource types have URIs, yay
    (worth noting that the external uris for the islandora display terms persisted)

for the field config

so everything looks good and i'll go with not worrying about the update hook

@elizoller
Copy link
Member

i'm not sure how you'll want to handle documentation changes though

@kspurgin
Copy link
Contributor Author

Thanks for testing!

@kspurgin
Copy link
Contributor Author

I will make an issue assigned to me to update the documentation. I don't think it's a blocker --- more of a good citizen FYI act from one metadata person to another.

@elizoller
Copy link
Member

for sure

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