GithubHelp home page GithubHelp logo

apachesolr_angularjs_search's People

Contributors

kporras07 avatar mscraven avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

mscraven

apachesolr_angularjs_search's Issues

Trying to fix multiple delete forms with same form id.

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:

  1. Lines 120 to 123 as in https://github.com/ManatiCR/apachesolr_angularjs_search/blob/7.x-1.x/src/components/booleansPopup/booleansPopup.directive.js#L120
  2. Lines 128 to 132 as in https://github.com/ManatiCR/apachesolr_angularjs_search/blob/7.x-1.x/src/components/booleansPopup/booleansPopup.directive.js#L128

Pasting a patch file with these changes.

Thanks.

fix_apachesolr_angularjs_search_patch.txt

JS Errors

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.