- 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
Nice feature.
Should we make this a checkbox in the block configuration to enable or disable this feature? And we would enable this by default.- If people want to customize in their theme, it might be best to have an option to not add any javascript.
- It might be best if the javascript was based on a class that we add ourselves because in a theme the class "form-search" could be missing or used in other spots. - Status changed to Needs work
about 2 years ago 2:08am 3 February 2023 - Status changed to Needs review
11 months ago 3:42pm 4 June 2024 - Merge request !8Issue #3320560: Added default value and cache context to search api form. → (Merged) created by Vivek Panicker
- Status changed to RTBC
9 months ago 8:46am 6 August 2024 - 🇮🇳India atul_ghate
I have reproduced the issue successfully.
The MR8 is applied cleanly.I followed the steps below to reproduce the issue:
1.Cloned the 1.0.x version of the module.
2.Installed its dependencies and enabled both modules.
3.Create a view for content and add exposed filter and configure
4.add serach api form by configuring it with key and action view url
5.Reproduced the issue both without MR8 changes and with MR8 applied.
Changing its status to RTBC. - Status changed to Needs work
5 months ago 1:12pm 15 November 2024 - 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
I would probably set the cache to only be set on the query parameter and not the whole URL. That way we have a unique cache when the parameter is not there.
$form['#cache']['contexts'][] = 'url.query_args:' . $input_name;
PS: I didn't test this code, just followed the documentation:
https://www.drupal.org/docs/drupal-apis/cache-api/cache-contexts → - 🇮🇳India Vivek Panicker Kolkata
@phjou I agree your solution is better. The cache variation then would only depend on the specific query argument based on the input field name and not on the entire URL. So even if other query args are present, the cached data would ignore those.
- 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
I guess we want to set the context only if the input name is not empty. Otherwise it looks good
$form['#cache']['contexts'][] = 'url.query_args:' . $input_name;
-
phjou →
committed a72ce7ad on 1.0.x authored by
vivek panicker →
Issue #3320560: Added default value and cache context to search api form...
-
phjou →
committed a72ce7ad on 1.0.x authored by
vivek panicker →
- 🇮🇳India Vivek Panicker Kolkata
Hey @phjou! Thank you for merging the fix!
I would just like to inform you that according to the latest update, the maintainer has to manually provide credits to the involved participants in the Credit and Committing section in the issue.
So if anyone deserves credit here, kindly do give them! :)
- Status changed to Fixed
3 days ago 10:21pm 22 April 2025 - 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺
@vivek Thanks for the reminder, I added the credits. I was too used to the time where the checkboxes were checked by default when somebody was uploading a file.