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

Ignore AppConfig[:limit_csv_fields] unless the params[:dt] == 'csv' #3156

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

martinlovell
Copy link

@martinlovell martinlovell commented Mar 10, 2024

Ignore the AppConfig[:limit_csv_fields] value unless the request type is csv

Description

The AppConfig[:limit_csv_fields] property causes the Search model to ignore the fields parameter. This causes all fields to be returned from the query. The AppConfig[:limit_csv_fields] should limit the fields returned by the search only when dt=xml. This change allows a JSON search to limit the number of fields returned when the app is configured with AppConfig[:limit_csv_fields] = false.

Related JIRA Ticket or GitHub Issue

https://archivesspace.atlassian.net/browse/ANW-1975

How Has This Been Tested?

I added four tests to model_search_test.rb to ensure that the fl parameter is sent to SOLR appropriately based on AppConfig[:limit_csv_fields] and the dt parameter.

Screenshots (if appropriate):

n/a

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.

@martinlovell martinlovell marked this pull request as ready for review March 10, 2024 14:59
@cdibella cdibella added the community code contributed by community members not on or contracted by the ArchivesSpace program team label Mar 11, 2024
@brianzelip
Copy link
Collaborator

Thanks @martinlovell -- we'll have a look and follow up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community code contributed by community members not on or contracted by the ArchivesSpace program team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants