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

Make MARC subject heading sort behavior configurable #3644

Merged

Conversation

rominail
Copy link
Contributor

@rominail rominail commented May 7, 2024

Subjects appear in item display in the same order they appear in the MARC record, e.g. if a 651 is entered before a 650, the display matches that.
Example : https://catalog.lib.msu.edu/Record/folio.in00006796642#details

TODO

  • Update changelog when merging

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Excellent work, @rominail -- thank you for the contribution!

I have just a couple of minor stylistic suggestions below (and please feel free to disagree with me if you have strong feelings to the contrary).

It might also be nice to add a test case to SolrMarcTest.php to cover the new scenario. I'm happy to help with that if you need me to!

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @rominail -- a few more very minor points of style.

Please let me know if you'd like me to add a test for you, or if you plan to work on that. Once we have test coverage, this should be just about ready to merge.

@rominail
Copy link
Contributor Author

rominail commented May 8, 2024

I made all the modifications
I modified the testSubjectHeadings function, however I am not sure if it should be split in 2 sub-functions.
Also I don't know neither how to alter the record to be able to test if the results are sorted the way we expect instead of just making sure it returns the right values

@demiankatz
Copy link
Member

Thanks, @rominail. If you have an example MARC record containing out-of-sequence subject headings, we could create a new test fixture by indexing it and then capturing the Solr response for a request to retrieve it. We could add the test fixture to the fixtures directory and adjust the test case to use it.

It would also probably make sense to use a @dataProvider annotation on the test to separate the different configuration cases, instead of looping through them inside a single test case. If you haven't done this before, I can help refactor.

If you're not sure how best to set up the fixture, I'm also happy to help with that, but if you could at least provide a suitable MARC record that would be a useful starting point.

@rominail
Copy link
Contributor Author

rominail commented May 9, 2024

I made the test, let me know what you think of it

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

Thanks, @rominail, the test looks great! My last thought is simply that we might want to rename the new config setting for clarity; see below. Please let me know what you think about that (and my related comments), and once that detail is settled, this can be merged.

config/vufind/config.ini Outdated Show resolved Hide resolved
@demiankatz
Copy link
Member

Thanks, @rominail -- sorry for breaking your PR. I was trying to save you some time by making small fixes via GitHub while my test VM was tied up with another process, but I clearly didn't quite do everything correctly. :-)

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

A couple of proposed finishing touches:

config/vufind/config.ini Outdated Show resolved Hide resolved
@rominail
Copy link
Contributor Author

rominail commented May 9, 2024

Thanks, @rominail -- sorry for breaking your PR. I was trying to save you some time by making small fixes via GitHub while my test VM was tied up with another process, but I clearly didn't quite do everything correctly. :-)

NP, thanks for helping :)

@demiankatz demiankatz added this to the 10.0 milestone May 9, 2024
@demiankatz demiankatz added new feature small Minor changes to relatively few files labels May 9, 2024
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

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

This is working as expected now. Thanks again!

@demiankatz demiankatz merged commit 908047d into vufind-org:dev May 9, 2024
7 checks passed
@demiankatz demiankatz changed the title Subject headings ordered by saved marc Make MARC subject heading sort behavior configurable May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature small Minor changes to relatively few files
Projects
None yet
3 participants