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

Issue 1561: Remove dependency on Name module #54

Merged
merged 9 commits into from
Sep 25, 2020
Merged

Issue 1561: Remove dependency on Name module #54

merged 9 commits into from
Sep 25, 2020

Conversation

seth-shaw-unlv
Copy link
Contributor

GitHub Issue: Islandora/documentation#1561

Alternate to @rosiel's PR: #53

What does this Pull Request do?

Removes the dependency on the Name module (they will only see the alternate name string field on a fresh islandora install), but keeps the related fields around in case someone wants to install the module themselves. (Prevents breaking new ArchivesSpace Module installs which use these fields.)

What's new?

*. Moves the person preferred name and alternate name fields from install to optional.

  • Adds a new alternate name (string) field.
  • Removes the dependency on the name module.
  • Moves the name module in composer to the suggested section with a note that it provides for structured western-centric names.

How should this be tested?

  • Take a fresh islandora
  • Delete the prefered and alternate name fields from the person taxonomy.
  • Apply the PR and clear cache.
  • Uninstall (http://localhost:8000/admin/modules/uninstall) the Name module. (That is the primary requirement.)
  • Import the controlled access terms defaults feature (http://localhost:8000/admin/config/development/features/diff/controlled_access_terms_defaults)
  • Check the Person taxonomy that only the new string-based alternate name string field is available.

Additional Comments

I figured it would be easier to just go ahead and make a fresh PR rather than making @rosiel slog through the manual edits again. Let me know if there is anything I missed.

Interested parties

@Islandora/8-x-committers, especially @rosiel.

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, can haz review?

@mjordan
Copy link
Contributor

mjordan commented Sep 17, 2020

Sorry, will do by end of this week.

@rosiel
Copy link
Member

rosiel commented Sep 17, 2020

Sorry I missed this the first time around! :D Thanks so much for doing this Seth! If I have time I will try to test it out, but I can't make any promises.

@mjordan
Copy link
Contributor

mjordan commented Sep 21, 2020

@seth-shaw-unlv when I import the controlled access terms defaults feature, I get a WSOD with this in my apache error.log:

Uncaught PHP Exception Drupal\\Component\\Plugin\\Exception\\PluginNotFoundException: "Unable to determine class for field type 'name' found in the 'field.storage.0' configuration" at /var/www/html/drupal/web/core/modules/field/src/FieldStorageConfigStorage.php line 174, referer: http://localhost:8000/admin/config/development/features/diff/controlled_access_terms_defaults

Any suggestions?

@seth-shaw-unlv
Copy link
Contributor Author

Strange. I'll see if I can take a look at it today.

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, okay, I see what is happening here...

Features isn't intelligent enough to distinguish the optional v. install directory. So, if you simply drush fim -y controlled_access_terms_defaults or simply select all in the UI it will attempt to bring in the optional name fields. This, of course, crashes it because the optional name configs no longer have the name module available.

So, when you go to features, explicitly omit the person name fields and field storage configs.

Although, I guess the best way to test is to build a fresh install targeting this branch....

@seth-shaw-unlv
Copy link
Contributor Author

We can either do that by moving the branch to the main repo and update an inventory variable OR take a local copy of the playbook and hack out the controlled access terms so it doesn't get installed during the build add it manually afterward...

@seth-shaw-unlv
Copy link
Contributor Author

I've moved a copy of the branch to the Islandora repo and I've kicked off a fresh build; however, now that I think about it, I think I would ALSO need to make a testing branch of Islandora Defaults and update it's composer requirement of controlled access terms to avoid a composer version conflict. 🤦‍♂️

Maybe I'll just kill the post-install step to resolve this manually...

@seth-shaw-unlv
Copy link
Contributor Author

Oh, bother, it isn't as simple as that, either. I need to carve out the modules enabled by the install drupal step as well.

@mjordan
Copy link
Contributor

mjordan commented Sep 21, 2020

Just thought of something - will changes aroud this require an update hook in the .install file?

@seth-shaw-unlv
Copy link
Contributor Author

No. This only impacts new installs. Existing sites will not see any changes. We would only need an update hook if we were replacing the primary and alternate name fields with something else and had to update existing data.

I went ahead and created a testing PR on islandora_defaults. This means all you need to do is build a fresh playbook (not using the pre-built VM) with the composer require as "islandora/islandora_defaults:dev-issue-1561" (see inventory/vagrant/group_vars/webserver/drupal.yml circa line 22). This actually surfaced an issue with one of the configs where field_permissions had snuck in. I've restarted my build.

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan , new testing instructions:

@mjordan
Copy link
Contributor

mjordan commented Sep 22, 2020

I think I'm doing something wrong. Using ubuntu as the $vagrantBox, and "islandora/islandora_defaults:issue-1561" in my drupal.yml file, the build is failing with this:

failed: [default] (item=islandora/islandora_defaults:issue-1561) => {"changed": false, "item": "islandora/islandora_defaults:issue-1561", "msg": "[UnexpectedValueException] Could not parse version constraint issue-1561: Invalid version string \"issue-1561\" require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...", "stdout": "\n \n [UnexpectedValueException] \n Could not parse version constraint issue-1561: Invalid version string \"issue-1561\" \n \n\nrequire [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...\n\n", "stdout_lines": ["", " ", " [UnexpectedValueException] ", " Could not parse version constraint issue-1561: Invalid version string \"issue-1561\" ", " ", "", "require [--dev] [--prefer-source] [--prefer-dist] [--fixed] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...", ""]}

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, you dropped the "dev-" in the composer line. "islandora/islandora_defaults:dev-issue-1561"

@seth-shaw-unlv
Copy link
Contributor Author

I just checked Travis. None of these messages are related to this particular PR.

@mjordan
Copy link
Contributor

mjordan commented Sep 22, 2020

Rebuilding now.

@mjordan
Copy link
Contributor

mjordan commented Sep 22, 2020

@seth-shaw-unlv fixed my ansible variable, all ran OK until I hit this: Configuration objects provided by <em class=\"placeholder\">islandora_search< \n /em> have unmet dependencies: <em class=\"placeholder\">search_api.index.defa \n ult_solr_index (field.storage.taxonomy_term.field_person_alternate_names, f \n ield.storage.taxonomy_term.field_person_preferred_name)</em>.

Here's the entire stderr output, for context:

TASK [geerlingguy.drupal : Install configured modules with drush.] ************* Tuesday 22 September 2020 07:27:20 -0700 (0:01:36.225) 0:26:21.924 ***** fatal: [default]: FAILED! => {"changed": true, "cmd": ["/var/www/html/drupal/vendor/drush/drush/drush", "pm-enable", "-y", "rdf", "responsive_image", "syslog", "serialization", "basic_auth", "rest", "simpletest", "restui", "devel", "search_api_solr", "facets", "content_browser", "matomo", "pdf", "admin_toolbar", "transliterate_filenames", "islandora_defaults", "controlled_access_terms_defaults", "islandora_defaults", "islandora_fits", "islandora_breadcrumbs", "islandora_iiif", "islandora_oaipmh", "islandora_search", "--root=/var/www/html/drupal/web"], "delta": "0:07:41.292101", "end": "2020-09-22 14:35:01.905547", "msg": "non-zero return code", "rc": 1, "start": "2020-09-22 14:27:20.613446", "stderr": "\nIn UnmetDependenciesException.php line 98:\n \n Configuration objects provided by <em class=\"placeholder\">islandora_search< \n /em> have unmet dependencies: <em class=\"placeholder\">search_api.index.defa \n ult_solr_index (field.storage.taxonomy_term.field_person_alternate_names, f \n ield.storage.taxonomy_term.field_person_preferred_name)</em> \n \n\npm:enable [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--druplicon] [--notify [NOTIFY]] [--] <command> [<modules>]...", "stderr_lines": ["", "In UnmetDependenciesException.php line 98:", " ", " Configuration objects provided by <em class=\"placeholder\">islandora_search< ", " /em> have unmet dependencies: <em class=\"placeholder\">search_api.index.defa ", " ult_solr_index (field.storage.taxonomy_term.field_person_alternate_names, f ", " ield.storage.taxonomy_term.field_person_preferred_name)</em> ", " ", "", "pm:enable [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--druplicon] [--notify [NOTIFY]] [--] <command> [<modules>]..."], "stdout": "The following module(s) will be enabled: responsive_image, syslog, serialization, basic_auth, rest, simpletest, restui, devel, search_api_solr, facets, content_browser, matomo, pdf, admin_toolbar, transliterate_filenames, islandora_defaults, controlled_access_terms_defaults, islandora_fits, islandora_breadcrumbs, islandora_iiif, islandora_oaipmh, islandora_search, language, search_api, entity_browser, entity_embed, embed, content_translation, context, controlled_access_terms, geolocation, token, eva, field_group, field_permissions, islandora, jsonld, hal, jwt, key, filehash, context_ui, action, media, prepopulate, features_ui, features, config_update, migrate_tools, migrate, migrate_plus, migrate_source_csv, flysystem, file_replace, islandora_audio, islandora_core_feature, islandora_image, islandora_text_extraction_defaults, islandora_text_extraction, islandora_video, openseadragon, libraries, rest_oai_pmh\n\n // Do you want to continue?: yes. ", "stdout_lines": ["The following module(s) will be enabled: responsive_image, syslog, serialization, basic_auth, rest, simpletest, restui, devel, search_api_solr, facets, content_browser, matomo, pdf, admin_toolbar, transliterate_filenames, islandora_defaults, controlled_access_terms_defaults, islandora_fits, islandora_breadcrumbs, islandora_iiif, islandora_oaipmh, islandora_search, language, search_api, entity_browser, entity_embed, embed, content_translation, context, controlled_access_terms, geolocation, token, eva, field_group, field_permissions, islandora, jsonld, hal, jwt, key, filehash, context_ui, action, media, prepopulate, features_ui, features, config_update, migrate_tools, migrate, migrate_plus, migrate_source_csv, flysystem, file_replace, islandora_audio, islandora_core_feature, islandora_image, islandora_text_extraction_defaults, islandora_text_extraction, islandora_video, openseadragon, libraries, rest_oai_pmh", "", " // Do you want to continue?: yes. "]}

Looks like the islandora_search configs need to be updated?

vagrant@islandora8:/var/www/html/drupal/web/modules/contrib/islandora_defaults/modules/islandora_search$ grep -r alternate_names * results in

config/install/search_api.index.default_solr_index.yml: - field.storage.taxonomy_term.field_person_alternate_names config/install/search_api.index.default_solr_index.yml: property_path: 'field_person_alternate_names:family' config/install/search_api.index.default_solr_index.yml: - field.storage.taxonomy_term.field_person_alternate_names config/install/search_api.index.default_solr_index.yml: property_path: 'field_person_alternate_names:given' config/install/search_api.index.default_solr_index.yml: - field.storage.taxonomy_term.field_person_alternate_names config/install/search_api.index.default_solr_index.yml: property_path: 'field_person_alternate_names:middle' config/install/search_api.index.default_solr_index.yml: - field.storage.taxonomy_term.field_person_alternate_names

@seth-shaw-unlv
Copy link
Contributor Author

I think you are right... give me a minute.

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, we are green now. I've also made a PR for islandora_defaults to fix the islandora_search. Give it a try again.

@mjordan
Copy link
Contributor

mjordan commented Sep 22, 2020

Do I need to do anything to pull that in or just rebuild?

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, just vagrant destroy and rebuild.

@mjordan
Copy link
Contributor

mjordan commented Sep 22, 2020

Rebuilt using those updates, getting this:

TASK [webserver-app : Import features] ***************************************** Tuesday 22 September 2020 15:31:11 -0700 (0:00:00.168) 0:31:28.298 ***** fatal: [default]: FAILED! => {"changed": true, "cmd": ["/var/www/html/drupal/vendor/drush/drush/drush", "--root", "/var/www/html/drupal/web", "-y", "fim", "islandora_core_feature,controlled_access_terms_defaults,islandora_defaults,islandora_search"], "delta": "0:00:16.558000", "end": "2020-09-22 22:31:27.748950", "msg": "non-zero return code", "rc": 1, "start": "2020-09-22 22:31:11.190950", "stderr": "\nIn FieldStorageConfigStorage.php line 174:\n \n Unable to determine class for field type 'name' found in the 'field.storage \n .0' configuration \n \n\nIn DiscoveryTrait.php line 53:\n \n The \"name\" plugin does not exist. Valid plugin IDs for Drupal\\Core\\Field\\Fi \n eldTypePluginManager are: comment, edtf, authority_link, typed_relation, da \n tetime, file, file_uri, geolocation, image, link, list_integer, list_float, \n list_string, path, text_with_summary, text, text_long, created, map, uri, \n boolean, entity_reference, string, password, changed, timestamp, integer, e \n mail, language, decimal, uuid, string_long, float \n \n\nfeatures:import [--bundle [BUNDLE]] [--force [FORCE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--druplicon] [--notify [NOTIFY]] [--] <command> <feature>", "stderr_lines": ["", "In FieldStorageConfigStorage.php line 174:", " ", " Unable to determine class for field type 'name' found in the 'field.storage ", " .0' configuration ", " ", "", "In DiscoveryTrait.php line 53:", " ", " The \"name\" plugin does not exist. Valid plugin IDs for Drupal\\Core\\Field\\Fi ", " eldTypePluginManager are: comment, edtf, authority_link, typed_relation, da ", " tetime, file, file_uri, geolocation, image, link, list_integer, list_float, ", " list_string, path, text_with_summary, text, text_long, created, map, uri, ", " boolean, entity_reference, string, password, changed, timestamp, integer, e ", " mail, language, decimal, uuid, string_long, float ", " ", "", "features:import [--bundle [BUNDLE]] [--force [FORCE]] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--druplicon] [--notify [NOTIFY]] [--] <command> <feature>"], "stdout": "", "stdout_lines": []}

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan , that is related to the islandora_defaults PR. I think I have a solution for that... but the final bit will involve a PR to islandora_playbook to stop trying to feature import the controlled_access_terms_defaults config (which is unnecessary).

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, sorry this has been such a pain to test! I think we may finally have it though... I have a new islandora_playbook PR that simply stops attempting to feature import controlled_access_terms_defaults (but also targets these testing branches).

Once everything is approved, I can remove the edits to the islandora_playbook and islandora_defaults PRs targeting these issue branches before merging. Then the merge order is islandora_playbook→islandora_defaults→controlled_access_terms.

@mjordan
Copy link
Contributor

mjordan commented Sep 23, 2020

No problem. Am testing Islandora-Devops/islandora-playbook#190 now.

@mjordan
Copy link
Contributor

mjordan commented Sep 23, 2020

Build incorporating Islandora-Devops/islandora-playbook#190 successful:

namefields

But within the Drupal instance, name is still a dependency in controlled_access_terms.info.yml. I may have missed a step somewhere; git diff in my islandora-playbook directory (at commit 1797a891ca507ce088b94b3b03757eac28698d1d) shows:

diff --git a/inventory/vagrant/group_vars/webserver/drupal.yml b/inventory/vagrant/group_vars/webserver/drupal.yml
index 7e2982d..15ffffc 100644
--- a/inventory/vagrant/group_vars/webserver/drupal.yml
+++ b/inventory/vagrant/group_vars/webserver/drupal.yml
@@ -19,7 +19,7 @@ drupal_composer_dependencies:
   - "drupal/rest_oai_pmh:^1.0"
   - "drupal/transliterate_filenames:^1.3"
   - "islandora/carapace:dev-8.x-3.x"
-  - "islandora/islandora_defaults:dev-8.x-1.x"
+  - "islandora/islandora_defaults:dev-issue-1561"
   - "islandora-rdm/islandora_fits:dev-master"
 drupal_composer_project_package: "islandora/drupal-project:8.8.1"
 drupal_composer_project_options: "--prefer-dist --stability dev --no-interaction"

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, I had already updated that branch to no longer point at the new controlled access terms branch when you stated that build.

@seth-shaw-unlv
Copy link
Contributor Author

Writing from my phone while I wait for the toddler to drop into a deeper sleep before I can put her down. I can chat about it on slack when I get back to the computer.

@mjordan
Copy link
Contributor

mjordan commented Sep 24, 2020

OK, build successful, name is no longer a dependency in controlled_access_terms.info.yml, and the fields in the Person taxo look good:

namefields

I'll approve this PR. Let me know when you're ready for me to merge.

Copy link
Contributor

@mjordan mjordan left a comment

Choose a reason for hiding this comment

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

All looks good to me (see #54 (comment)). @rosiel you're listed as a reviewer, you OK with this?

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, we need Islandora/islandora_defaults#36 approved and merged first. If you are happy with it I can remove the reference to this PR for it to be merged. Then we can merge this one.

@mjordan
Copy link
Contributor

mjordan commented Sep 24, 2020

Islandora/islandora_defaults#36 tested and merged.

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan , go ahead and squash/merge this one. It was islandora_defaults that we needed updating before merging. I've created a new PR to fix it: Islandora/islandora_defaults#37.

@mjordan mjordan merged commit fc2cd26 into Islandora:8.x-1.x Sep 25, 2020
@mjordan
Copy link
Contributor

mjordan commented Sep 25, 2020

@seth-shaw-unlv anything else we need to do? Thanks for this, it was pretty complex (to me anyway)!

@seth-shaw-unlv
Copy link
Contributor Author

@mjordan, nope! All done. When I started I didn't realize how complex testing it thoroughly would be. It is good to put this one to rest.

@seth-shaw-unlv seth-shaw-unlv deleted the issue-1561 branch September 25, 2020 04:47
@mjordan
Copy link
Contributor

mjordan commented Sep 25, 2020

I'll close the issue.

@nigelgbanks
Copy link
Member

Not 100% sure if this is related but I'm now seeing this on fresh installs after attempting to enable the feature.

> drush fim --no-interaction --yes controlled_access_terms_defaults

In FieldStorageConfigStorage.php line 174:
                                                                                                
  Unable to determine class for field type 'name' found in the 'field.storage.0' configuration  
                                                                                                

In DiscoveryTrait.php line 53:
                                                                                                                            
  The "name" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FieldTypePluginManager are: comment, typed_rela  
  tion, edtf, authority_link, datetime, file, file_uri, geolocation, image, link, list_float, list_string, list_integer, p  
  ath, text_long, text_with_summary, text, decimal, entity_reference, string, uuid, boolean, map, changed, created, passwo  
  rd, float, language, string_long, integer, email, uri, timestamp                                                          
                                                                            

@nigelgbanks
Copy link
Member

I've read through the issue history, the module and some more background information. I now understand that it must be enabled through the Features UI as drush does not provide an option to skip optional configurations in a feature. Though one can specify each configuration separately i.e.

drush  -v fim --no-interaction --yes controlled_access_terms_defaults:core.entity_form_display.taxonomy_ter
m.corporate_body.default

@seth-shaw-unlv, and @mjordan, could this instead be split into two separate features? I ask because I have an automated process by which I create sites, where no manual steps are used. I'm willing to make those changes and tests them if a pull request would be accepted.

@seth-shaw-unlv
Copy link
Contributor Author

@nigelgbanks, doing a feature import isn't necessary for using the module. I don't recall why we started doing the feature import for islandora_defaults as part of the install process, but simply installing the module is all you need to do for start up. The feature import is only a convenience for updating a feature after making local changes to the module's configurations or testing a PR.

@nigelgbanks
Copy link
Member

Thanks @seth-shaw-unlv that makes sense.

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.

4 participants