-
Notifications
You must be signed in to change notification settings - Fork 255
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
Only show search context controls if the current context matches the … #2297
Conversation
@@ -68,7 +68,7 @@ def link_to_next_document(next_document) | |||
# session_tracking_params(SolrDocument.new(id: 123), 7) | |||
# => { data: { :'context-href' => '/catalog/123/track?counter=7&search_id=999' } } | |||
def session_tracking_params document, counter | |||
path = session_tracking_path(document, per_page: params.fetch(:per_page, search_session['per_page']), counter: counter, search_id: current_search_session.try(:id)) | |||
path = session_tracking_path(document, per_page: params.fetch(:per_page, search_session['per_page']), counter: counter, search_id: current_search_session.try(:id), document_id: document.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without a safe navigation operator you get a id
not defined on nil error when you click on the first result.
path = session_tracking_path(document, per_page: params.fetch(:per_page, search_session['per_page']), counter: counter, search_id: current_search_session.try(:id), document_id: document.id) | |
path = session_tracking_path(document, per_page: params.fetch(:per_page, search_session['per_page']), counter: counter, search_id: current_search_session.try(:id), document_id: document&.id) |
I am on 7.5.1 for my purposes and we have some local differences in our placement of where we render |
c31387f
to
73c7a8b
Compare
Just rebased and then added a rubocop |
4e6a735
to
c47b337
Compare
I took the liberty of fleshing this PR out some more, hope that's okay. I wasn't sure of a couple of thing: 1) if the |
Co-authored-by: Charlie Morris <523381+cdmo@users.noreply.github.com>
…back to search" buttons
0b94ff3
to
2ca1c96
Compare
…current document
Maybe helps address or obscure the problems from #2295?