Skip to content

Use getName() instead of ->name.#116

Merged
seth-shaw-asu merged 1 commit intoIslandora:2.xfrom
rosiel:search-plugin-fix
Mar 20, 2024
Merged

Use getName() instead of ->name.#116
seth-shaw-asu merged 1 commit intoIslandora:2.xfrom
rosiel:search-plugin-fix

Conversation

@rosiel
Copy link
Member

@rosiel rosiel commented Mar 17, 2024

GitHub Issue: #89

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

What does this Pull Request do?

Fixes a badness where I used a protected property $term->name instead of the proper $term->getName()

What's new?

  • Cleaned up code!
  • Does this change require documentation to be updated? no
  • Does this change add any new dependencies? no
  • Does this change require any other modifications to be made to the repository
    (i.e. Regeneration activity, etc.)? no
  • Could this change impact execution of existing code? no

How should this be tested?

There is no broken behaviour to fix, this just makes the code more future-friendly.
To ensure this works:

  • add some content with various linked agents/contributors, with different roles. For example, make some "Author" and some "Contributor".
  • Go to Search API config > Default solr content Index > Processors. Enable the "Typed Relation filtered by type" processor if it isn't already.
  • Switch from the Processors tab to the Fields tab. Add a new field. Scroll down (past General) to the Content section, and find Contributors (formerly Linked Agent) under the list of fields. there should be an option for "Contributors (filtered by type)". Add it and select one or more relator terms that you want included in this field. For best testing, include some but not all of the relator terms used in your content. For example include Authors but not Contributors.
  • Re-index your content.

Dev way (if your system allows):

  • Check Solr, and see that the index includes a field with the names of the terms with only the relator(s) that you selected.

Non-solr way:

  • Create a Facet for your new field, and place the newly created facet's Block in the sidebar. Do a search and see that your facet shows only the terms with the relator you selected.

Additional Notes:

Any additional information that you think would be helpful when reviewing this
PR.

Interested parties

@ajstanley

Copy link
Contributor

@ajstanley ajstanley left a comment

Choose a reason for hiding this comment

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

Works perfectly.

@seth-shaw-asu seth-shaw-asu merged commit 9c9a3f6 into Islandora:2.x Mar 20, 2024
@rosiel rosiel deleted the search-plugin-fix branch March 20, 2024 17:08
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.

3 participants