manaticr / apachesolr_angularjs_search Goto Github PK
View Code? Open in Web Editor NEWApache AngularJS Search
Apache AngularJS Search
Try:
bower.json
package.json
drupal
Hi guys - Michael Craven at John Hopkins Bloomberg School of Public Health Center for Communication Programs. My boss TJ Moyer posted a message to Basecamp asking about how the delete saved searches and delete search history was not working. We found that only the first search ever deleted on the My Popline search history or saved searches page. Upon inspection, we found that was because all of the delete forms (one per search) have the save form id. I fixed this by Changing the form id in apachesolr_angularjs_search_handler_field_delete_link.inc:
$form = drupal_get_form('apachesolr_angularjs_search_delete_form_'.$sid, $sid, $link_text);
appending the sid to the form id.
Then, in implementing hook_forms in the main module:
function apachesolr_angularjs_search_forms($form_id, $args) {
$forms = array();
if(preg_match('/^apachesolr_angularjs_search_delete_form_\d+/', $form_id)) {
$forms[$form_id] = array(
'callback' => 'apachesolr_angularjs_search_delete_form_callback'
);
}
return $forms;
}
Then renaming apachesolr_angularjs_search_delete_form as apachesolr_angularjs_search_delete_form_callback and explicitly adding the submit.
function apachesolr_angularjs_search_delete_form_callback($form, $form_state, $sid, $delete_text) {
$form['sid'] = array(
'#type' => 'value',
'#value' => $sid,
);
$form['delete'] = array(
'#type' => 'submit',
'#value' => check_plain($delete_text),
);
$form['#submit'] = array (
'apachesolr_angularjs_search_delete_form_submit'
);
return $form;
}
This seemed to fix it.
The second issue was that non autocomplete fields would append an 'AND' and the text that had already been entered when the user hits 'enter.' This problem was fixed by your suggestion on Basecamp:
This appears to be a bug caused by an unexpected event propagation that invokes some code that should never be executed in this context. My advice is to wrap that code and other (I'll provide links) with the next condition:
if ($event.explicitOriginalTarget === $event.target) {}
Jeff Lyon posted a comment about this message on Basecamp
I would wrap:
Pasting a patch file with these changes.
Thanks.
I'm getting errors when the apachesolr-angularjs-search block loads on my pages.
To wit:
_app.js?o6q3hw:1 Uncaught TypeError: Cannot read property 'prototype' of undefined
vendor.js?o6q3hw:2 Error: [ng:areq] Argument 'mainController' is not a function, got undefined
_and finally
_vendor.js?o6q3hw:1 Uncaught Error: [$injector:unpr] Unknown provider: drupalDataServiceProvider <- drupalDataService
_
This looks to me as if the app isn't initializing properly in the first place.
Can anyone point me to the next step in debugging this?
TIA
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.