dartmouth-dltg / local_contexts_projects

An ArchivesSpace plugin to integrate with Local Contexts Labels and Notices
2 stars 0 forks source link

export pdf on the ArchivesSpace staff interface is failing #3

Open jrcwiok opened 4 months ago

jrcwiok commented 4 months ago

Hello - I've tried each version (1.0.7, 1.0.8, 1.0.9) of the plugin with ArchivesSpace v3.5.1 and keep getting this error. Version 1.0.8 does not display the Local Contents Open to Collaborate notice. When I export a pdf on the staff interface for some resource records, I get the following error. Any help would be appreciated!

undefined method each' for nil:NilClass /archivesspace/plugins/local_contexts_projects/backend/lib/local_contexts_ead_helper.rb:5:ininclude_lcps?' /archivesspace/plugins/local_contexts_projects/backend/lib/local_contexts_ead.rb:52:in serialize_local_contexts_ead_for_digital_objects' /archivesspace/plugins/local_contexts_projects/backend/lib/local_contexts_serializer.rb:18:incall'

jdshaw commented 3 months ago

Hello

Thanks for letting me know about these potential issues. You'll want to grab a version that is specifically for the version of ArchivesSpace that you are running. This is mentioned in the release notes. So, for AS v3.5.1, you'll want version 1.0.8.

Couple of quick housekeeping questions.

  1. Have you run the database setup script?
  2. Have you added the config options for the plugin? If so, can you post them here?

I've tested this in a local instance and I think I need a bit more information about your specific setup to do some more debugging.

  1. I am seeing the Open to Collaborate notice on the PUI homepage and in the exports. Any chance you've customized your welcome page? You may also have an old copy of the javascript that handles the Open to Collaborate display - try forcing a cache clear in your browser as well.

  2. I've tested the exports in the staff side, but can't reproduce this error. Can you give me some more information about the resources that produce the export error - specifically about digital objects that might be linked?

  3. Does this pre-release solve the export errors you are seeing? https://github.com/dartmouth-dltg/local_contexts_projects/releases/tag/v1.0.10

jdshaw commented 2 months ago

Just checking in on this issue to see if the updated releases have solved your issue?

jrcwiok commented 1 month ago

Hi! I'm working with Maine Archives to get them a log, but it's been a minute since I disabled the plugin for them. I'm going to reinstall tonight and get an export of the logs for you.

jrcwiok commented 1 month ago

log-events-viewer-result.csv Good morning,

I'm working with Maine Archives to troubleshoot version 1.0.16 of the local_contexts plugin. My observations are below. I also attached the log file for when I re-enabled the plugin on Maine State Archives site.

Here are my observations with the newest version of local_contexts installed on Maine State Archives. I'm rolling everything back with the plugin disabled and the statement hard coded on the landing page.

I installed local_contexts v1.0.16 tonight which resolves the printing problems. However, when I set the configuration open_to_collaborate => true, the local_contexts statement does not appear on the homepage. All of the other configurations are the plugin defaults. Local_contexts fields show on the staff side so I know it's installed even though the statement does not appear on the homepage - screenshots attached.

Version v1.0.7 is installed on the University of Maine's site with the configuration open_to_collaborate => true. The statement appears on the homepage, but they still have printing issues with records that have digital objects. All of the other configurations are the plugin defaults.

jdshaw commented 1 month ago

@jrcwiok Can you tell me what version of ArchivesSpace you are running locally? I'll need that to test on my end since releases of the plugin are scoped to specific versions of ArchivesSpace. Thanks!

jrcwiok commented 1 month ago

Sure thing, we are on version 3.5.1

jdshaw commented 1 month ago

Thanks! Let me see what's going on with the OTC notice.

jdshaw commented 1 month ago

Hmmm. I just tested this locally and I am seeing the OTC notice. Couple things to double check if you don't mind.

  1. Config is set as AppConfig[:local_contexts_projects] = {'open_to_collaborate' => true} You may also have some settings for staff_faceting and public_faceting in there
  2. Check the browser console for javascript errors and force clear the cache for your local site. This might show up if you were running a previous version of the plugin locally and the cached version is still being used.
  3. Are you running any other plugins that may have modified the homepage - ie welcome/show.html.erb
jdshaw commented 1 month ago

Can you also check in {path/to/archivesspace}/data/local_contexts_cache for a file called open_to_collaborate.json? That file should exist and the contents should look something like

{
    "notice_type": "open_to_collaborate",
    "name": "Open to Collaborate Notice",
    "default_text": "Our institution is committed to the development of new modes of collaboration, engagement, and partnership with Indigenous peoples for the care and stewardship of past and future heritage collections.",
    "img_url": "https://storage.googleapis.com/local-contexts-hub.appspot.com/labels/notices/ci-open-to-collaborate.png",
    "svg_url": "https://storage.googleapis.com/local-contexts-hub.appspot.com/labels/notices/ci-open-to-collaborate.svg",
    "usage_guides": "https://localcontexts.org/support/downloadable-resources/"
}

If that file does not exist, when you start up your local instance of AS, you should see a log entry of INFO -- : Checking cache for Open to Collaborate Notice. Do you see any errors in the log around/right after that entry?

jrcwiok commented 1 month ago

Thanks for this info!

  1. The settings for staff_faceting and public_faceting are set to the default false.
  2. I'll clear the cache when I run locally and I'll let you know what happens.
  3. When I re-enabled the plugin, there are no other overrides in place.

I see Checking cache for Open to Collaborate Notice in the logs, but there isn't an error.

jdshaw commented 1 month ago

If that json file exists for the OTC notice, then if the notice is not showing it'll either be a javascript issue (most likely an old cached version of the script) or some oddness when the OTC json is fetched from the local cache.

JS issues will show up in the browser dev tools console and any other issues should show up in the logs.

Keep me posted!

jrcwiok commented 1 month ago

Hi Joshua - running locally, we have v1.0.16 working as expected. I'll will try running with Maine State Archives site on our set up next. I've cleared the browser caches and docker cache. Fingers crossed.