-
Notifications
You must be signed in to change notification settings - Fork 37
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
Use metadata search as a facet - 7.x-ISLANDORA-1425 #37
Conversation
@adam-vessey I'd appreciate a look over this if you have a chance, as it was your code originally. In case I am missing something. |
@bradspry Can you also have a look at this? |
'!value' => rawurlencode(islandora_solr_facet_escape($original_value)), | ||
)); | ||
return t('<a href="@url">@val</a>', array( | ||
'@url' => url("islandora/search/") . '?type=dismax&f[0]=' . $solr_query, |
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.
Any particular reason this being changed to be a facet query?
@jordandukart it seemed to make it easier to deal with the internal data from the MODS record in much the same way it is handled in the faceting. The whole issue comes around the escaping of all the crazy stuff you get in MODS records you don't get people typing in a simple search box. That said I'm not tied to it, but it worked. |
@adam-vessey, does this look good to you? |
'!value' => urlencode(islandora_solr_replace_slashes(islandora_solr_lesser_escape($original_value))), | ||
'!value' => islandora_solr_facet_escape($original_value), | ||
)); | ||
return t('<a href="@url">@val</a>', array( |
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.
Why not just use l()
?
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.
Because that seemed to take me back to the original problem of double encoding of some characters.
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.
Is that referring to previous experimentation, appending to the path parameter itself in different ways?
l()
effectively degrades to this (assuming links aren't being taken over in the theme):
function l($text, $path, array $options = array()) {
// [... figure out $use_theme and handle "active" class ...]
if ($use_theme) {
return theme('link', array('text' => $text, 'path' => $path, 'options' => $options));
}
// The result of url() is a plain-text URL. Because we are using it here
// in an HTML argument context, we need to encode it properly.
return '<a href="' . check_plain(url($path, $options)) . '"' . drupal_attributes($options['attributes']) . '>' . ($options['html'] ? $text : check_plain($text)) . '</a>';
}
@
in t()
/format_string()
== check_plain()
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.
Yes, yes it was. Fair point, I have updated to use l()
instead of url()
.
Looks good. |
Thanks @adam-vessey, @bradspry do you want to confirm this solves the problem you experienced? |
@ruebot, @whikloj, I apologize, I did not catch the comment 9 days ago! Tested just now and all is well! (y) Subsequent facet links work, everything is rawurlencoded(), its a beautiful thing:
|
Use metadata search as a facet - 7.x-ISLANDORA-1425
Addresses ISLANDORA-1425