Problem/Motivation
Hello it seems this module can be used only with the search module. It would be great to make it work with Search API.
It seems that the form alters are made on forms provided by the search module that is not allowed to be activated at the same time as Search API otherwise you get a warning.
Maybe the first step would be to make the form id configurable instead of using harcoded tests:
if ($form_id == 'search_block_form' || $form_id == 'search_form')
I installed this module and just discovered that it is doing nothing when using Search API.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork better_search-3236805
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
phjouOk I've open a new merge request to make the form ID and the input name configurable.
I've put that in advanced settings so people go there only if they really need to since it's for developers.
I managed to see changes from better search with this module now: Search API block
There is a hook_update for websites who already have the module installed for those 2 new settings.
The code changes are not very big but should allow other modules to be able to use better search on top.
Comment #4
robcarrI applied the MR via a patch and it seemed to work fine with the Search API Block module. Couldn't get it to work with a Views Exposed Filter (as a block). Thanks for the work - really useful function
Comment #5
ryan-l-robinson commentedI've tested the merge request, also using search API and the search API button module. I must be missing something and I'm guessing I'm using the wrong values for those new advanced fields. I tried using "keys" for the input name, which I got by looking at the name property of the input field, and "block-searchapiform" for the Form ID, which I got by looking at the ID of the form block. I've tried other combinations like "search-api-form" or "searchapiform" for the Form ID as well.
Can you give some more guidance of which Form ID you are looking for?
Comment #6
ryan-l-robinson commentedUpdate: I got it this morning through some reverse engineering. It's search_api_form, not search-api-form. It doesn't work in my theme, but is now attempting to apply to the search API block.
Comment #7
phjouI just have rebased the branch so it can be merged again.
It would be nice to get that feature! Definitely blocking me from using this module.
Comment #4 was confirming that it was working.
Comment #8
phjouComment #9
ikeigenwijs commentedthe patch applies on dev
but i see the default form in all instances.
theme used barrio bootstrap
in advanced settings
form id:
search-api-page-block-form-zoeken
Comment #10
phjou@ikeigenwijs
Could you elaborate what needs to be changed or wrong? I am not understanding what the issue is? Do you Mean that you want to be able to configure multiple forms to use better search block?
Comment #11
orkutmuratyilmazHello all,
I've applied @phjou's commits and it works fine. Maybe @ikeigenwijs would like to add a more detailed explanation for the own results.
Best,
Orkut
Comment #12
robcarrThis patch works just fine (tested on 9.5.x and 10.1). Make sure if you are using the Search API exposed form that you've either uninstalled the core Search module or addressed any conflicts with routing, URLs etc
Comment #13
nicholassPatch works great!
Comment #14
nicholassOnly issue is the current MR diff is failing to patch with 1.6 release for me
Gathering patches for dependencies. This might take a minute.
- Installing drupal/better_search (1.6.0): Extracting archive
- Applying patches for drupal/better_search
https://git.drupalcode.org/project/better_search/-/merge_requests/1.diff (search api support https://www.drupal.org/project/better_search/issues/3236805)
Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/better_search/-/merge_requests/1.diff
Comment #15
phjouI would be great if a maintainer could review and merge.
I am still waiting for this to be merged in order to add automatic compatibility for "Better Search Block" into the "Search API block" module that I maintain.
PS: I would be happy to be added as maintainer too if you need help and see this message. I see that the Drupal 10 patch is still not merged :(
Comment #16
yogeshmpawarAdded to review list
Comment #17
sirclickalotI would also like to second the request to make the module compliant with Search API.
THANKS
Comment #19
yogeshmpawarCommitted & pushed to 2.0.x branch.
Comment #20
yogeshmpawarNew release with search api compatibility - https://www.drupal.org/project/better_search/releases/2.0.1
Comment #21
maxilein commentedIs there anything that needs to be mentioned in the readme or on the module page?
e.g.
Comment #22
orkutmuratyilmaz@yogeshmpawar thanks for the new release. Can you also add @maxilein's suggestion to the module page too?
Comment #23
phjouAmazing! Thank you.