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

Return display string in compact resource respresentations #3041

Merged

Conversation

mark-cooper
Copy link
Member

@mark-cooper mark-cooper commented Aug 29, 2023

Not all records have (or require) titles. However the PUI breadcrumbs for search were expecting a title, which when absent results in an error.

This is resolved by including the display string in compact results and using that as a fallback when title is not present.

Before (ao has no no title, display string not included):

      "_resolved_ancestors": {
        <!-- others ... -->
        "/repositories/2/archival_objects/2684": [
          {
            "publish": true,
            "level": "other level",
            "uri": "/repositories/2/archival_objects/2684"
          }
        ]
      }

After (ao has no title, includes display_string):

      "_resolved_ancestors": {
        <!-- others ... -->
        "/repositories/2/archival_objects/2684": [
          {
            "publish": true,
            "level": "other level",
            "uri": "/repositories/2/archival_objects/2684",
            "display_string": "1909, 1919, undated"
          }
        ]
      }

Steps to reproduce the issue

Create published records: resource -> child 1 (no title) -> child 2 (title)
In PUI search for child 2 title. Will error on master branch.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have authority to submit this code.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Not all record types have (or require) titles. However the
PUI breadcrumbs for search were expecting a title, which
when absent results in an error.

This is resolved by including the display string in compact
results and using that as a fallback when title is not
present.
@mark-cooper mark-cooper marked this pull request as ready for review August 30, 2023 16:52
@donaldjosephsmith donaldjosephsmith merged commit 2037169 into archivesspace:master Aug 30, 2023
10 checks passed
@cdibella cdibella added this to the 3.5.0 milestone Oct 4, 2023
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.

None yet

3 participants