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

"previous" and "next" navigation buttons do not remain when looking through catalog records from a list of results #4566

Open
Tracked by #4582 ...
caroldh opened this issue Nov 13, 2024 · 1 comment
Assignees
Labels
bug The application does not work as expected because of a defect

Comments

@caroldh
Copy link

caroldh commented Nov 13, 2024

Expected behavior

I would expect that navigation buttons remain as an option, so that I can continue to view next (or previous) records in my list of results.

Actual behavior

I have a list of search results, and when I click into the 1st record, I can see the "previous" and "next" available for me to navigate through the list. But if I click "next" to view the next record in the list, I no longer see the "previous" and "next" buttons.
1st record, where navigation is possible:
{400431BF-1B8C-430E-8BFA-A05559CBA262}

After clicking "next" to see next record, buttons are no longer available:
{64E94009-F76C-4EB4-98E1-FD1EDF9E796E}

Steps to replicate

Execute a search in catalog and get a list of results. Click on one of the records, and use "previous" or "next" to move in the list of results. On next record, you will no longer see options for "previous" or "next"

Impact of this bug

Cannot easily move through a list of search results.

Related Slack thread

@caroldh caroldh added the bug The application does not work as expected because of a defect label Nov 13, 2024
@christinach christinach mentioned this issue Nov 14, 2024
6 tasks
@christinach christinach self-assigned this Nov 14, 2024
@christinach
Copy link
Member

christinach commented Nov 15, 2024

Findings

Render ServerItemPaginationComponent

  • The render of the 'SearchContext::ServerItemPaginationComponent' that includes the Previous and Next links does not happen because one of the conditions (@search_session['document_id'] == @current_document_id) in the def render method returns false.

  • search context is always present.

<% if @search_context %>
      blacklight_config.track_search_session.storage: <%= blacklight_config.track_search_session.storage %></br>
      Prev_ID: <%= @search_context[:prev]["id"] %></br>
      Next_ID: <%= @search_context[:next]["id"] %></br>
      Document_ID: <%= @document.id %></br>
      SearchSession_ID: <%= search_session["document_id"] %></br>
      Document_ID == SearchSession_ID: <%= @document.id == search_session["document_id"] %></br>

          <%= link_back_to_catalog_safe class: 'btn btn-default button--back-to-search', label:  t('blacklight.back_to_search').html_safe %>
          <%= render(Orangelight::SearchContext::ServerItemPaginationComponent.new(search_context: @search_context, search_session: search_session, current_document: @document)) %>
      <% end %>

Example of the UI with debugging the output:

The search_session is updated with the current document.id

Previous and Next links display

The search_session is not updated with the current document.id :

Previous and next dont display

  • Nothing seems to have changed in the Blacklight::SearchContext module and specifically in the def session

Could this be a rails change in the actionpack that handles indifferentAccess or maybe we override something in the catalog that I haven't found yet.

@sandbergja @maxkadel @rladdusaw you all worked the last 2 weeks finishing the upgrade. Did you notice a change in the search_session?

Branch with code debugging output

christinach added a commit that referenced this issue Nov 15, 2024
The render of the 'SearchContext::ServerItemPaginationComponent' that includes the Previous and Next links does not happen because one of the conditions (@search_session['document_id'] == @current_document_id) in the
https://github.com/projectblacklight/blacklight/blob/1494bd0884efe7a48623e9b37abe558fa6348e2a/app/components/blacklight/search_context/server_item_pagination_component.rb#L14
method returns false.
the search_session is not updated with the current document.id
christinach added a commit that referenced this issue Nov 15, 2024
The render of the 'SearchContext::ServerItemPaginationComponent' that includes the Previous and Next links does not happen because one of the conditions (@search_session['document_id'] == @current_document_id) in the
https://github.com/projectblacklight/blacklight/blob/1494bd0884efe7a48623e9b37abe558fa6348e2a/app/components/blacklight/search_context/server_item_pagination_component.rb#L14
method returns false.
the search_session is not updated with the current document.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The application does not work as expected because of a defect
Projects
None yet
Development

No branches or pull requests

2 participants