Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Whenever I try to save a filter with alpha12, I get the following error. I tried to forcing the unsetting of min/max always and never in SearchApiFilterTrait->valueForm() but got nowhere.
Thanks for any assistance.
InvalidArgumentException: The configuration property display.default.display_options.filters.title.value.min doesn't exist. in Drupal\Core\Config\Schema\ArrayElement->get() (line 79 of core/lib/Drupal/Core/Config/Schema/ArrayElement.php).
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.title.value.min', '')
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.title.value', Array)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters.title', Array)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options.filters', Array)
Drupal\Core\Config\StorableConfigBase->castValue('display.default.display_options', Array)
Drupal\Core\Config\StorableConfigBase->castValue('display.default', Array)
Drupal\Core\Config\StorableConfigBase->castValue('display', Array)
Drupal\Core\Config\Config->save()
Drupal\Core\Config\Entity\ConfigEntityStorage->doSave('search', Object)
Drupal\Core\Entity\EntityStorageBase->save(Object)
Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object)
Drupal\Core\Entity\Entity->save()
Drupal\Core\Config\Entity\ConfigEntityBase->save()
Drupal\views_ui\ViewUI->save()
Drupal\views_ui\ViewEditForm->save(Array, Object)
call_user_func_array(Array, Array)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object)
Drupal\Core\Form\FormBuilder->processForm('view_edit_form', Array, Object)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object)
Drupal\Core\Entity\EntityFormBuilder->getForm(Object, 'edit', Array)
Drupal\views_ui\Controller\ViewsUIController->edit(Object, NULL)
call_user_func_array(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
This happens on search_api_db and search_api_solr and apparently isolated to fulltext. Incidentially, I do not have the option to choose Fulltext under the Filter options, even though some are defined under General and the bundle itself.
Comment | File | Size | Author |
---|---|---|---|
#17 | 2664286-17--views_date_filter.patch | 5.89 KB | drunken monkey |
Comments
Comment #2
grahlComment #3
grahlNo longer an issue with 1.x-dev
Comment #4
grahlSadly, I have to reopen this issue due to a remaining issue with the date field:
Call to undefined method Drupal\\search_api\\Plugin\\views\\query\\SearchApiQuery::addWhereExpression() in views/src/Plugin/views/filter/Date.php on line 188,
Apparently, without providing opSimple() Views adds a where expression directly. I copied the relevant portion over. Now my query executes but does not actually add the condition as expected but I'm unsure where the issue lies (see attached patch). This is complicated by an issue with value.min, which I file separately in a moment.
Comment #5
drunken monkeyAh, you're right, this really doesn't seem to work. Apparently I forgot to test that one while implementing Views filters. Thanks a lot for reporting this, and analyzing it already quite thoroughly!
Your patch also already goes into the right direction, I just adapted it a bit to hopefully arrive at something that will work for all cases, and also solve the exceptions when trying to save the view. Please test/review!
Also, ideal would of course be if we also had a test case for this functionality, to ensure it doesn't break again. Would you be willing to add such a test to our existing
ViewsTest::testView()
method?Comment #6
grahlThanks so much for your help! :-)
Patch works great with one minor change (value should have been set for offset from $this-value['value'] not $value).
I'll try to provide a test case and hand it back otherwise directly.
Comment #7
drunken monkeyAh, you're right, thanks for catching that!
Yes, a test would be great. Otherwise, please just report back here.
Comment #8
borisson_The comment needed to rewrapped.
Comment #9
drunken monkeyThe comment needs to be removed, not rewrapped, it makes no sense at all in our case. Seems we just copied that as-is from Views' SQL query plugin.
Comment #10
borisson_Removed the comment.
Comment #11
drunken monkeyThanks!
@ grahl: Are you still working on this? Any chance to add a test?
Comment #12
grahlSorry, I got swamped with other issues. I'll attempt to provide the test by Wednesday evening or hand it back.
Comment #13
grahlSorry, I couldn't provide a meaningful test setup in time.
Comment #14
drunken monkeyI hate Views so much …
But here are the tests, hopefully all working. Also created #2704077: Exposed operator for Views date filters doesn't accept "(not) empty" for a Views issue I encountered. (But worked around it here, of course.)
Comment #17
drunken monkeyJust one small oversight.
Comment #19
borisson_Code and test look great, the earlier fail was a random fail, see #2709899: php7 + postgres throws AlreadyInstalledException randomly.
Comment #20
borisson_Comment #22
drunken monkeyGood to hear, thanks for testing!
Committed.
Thanks again, everyone!
Comment #24
sagesolutions CreditAttribution: sagesolutions commentedI've ran into this issue using Drupal 8.2.4 and Search API 8.x-1.0-beta4 and search_api_solr 8.x-1.0-beta1
I created an issue at https://www.drupal.org/node/2841644, but now that I have found this issue, I think its the same thing and still happening for me.
Comment #25
magtak CreditAttribution: magtak at Acquia commentedI've ran into this issue using Drupal 8.2.5 and Search API 8.x-1.0-beta4
Steps to reproduce:
Step 3 might even be optional
Comment #26
anavarreSee #2843854: Test functionality of (not exposed) date filters