- Merge request !185#3548378: InvalidArgumentException when min and max values contain special characters → (Open) created by suryabhi
If a view is set up with min and max filters, and the values in the query string contain special characters, an uncaught exception is thrown.
InvalidArgumentException: The array contains invalid values. in Drupal\Component\Datetime\DateTimePlus::createFromArray() (line 180 of core/lib/Drupal/Component/Datetime/DateTimePlus.php).
Drupal\smart_date\Plugin\views\filter\Date->getMinAndMax() (Line: 177)
Drupal\smart_date\Plugin\views\filter\Date->opBetween() (Line: 346)
Drupal\views\Plugin\views\filter\NumericFilter->query() (Line: 1433)
Drupal\views\ViewExecutable->_build() (Line: 1322)
Drupal\views\ViewExecutable->build() (Line: 1451)
Drupal\views\ViewExecutable->execute() (Line: 1514)
Drupal\views\ViewExecutable->render() (Line: 133)
Drupal\views\Plugin\views\display\Block->execute() (Line: 1690)
Drupal\views\ViewExecutable->executeDisplay() (Line: 81)
Drupal\views\Element\View::preRenderViewElement() (Line: 61)
Drupal\views\Plugin\Block\ViewsBlock->build() (Line: 106)
Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 90)
Drupal\layout_builder\SectionComponent->toRenderArray() (Line: 88)
Drupal\layout_builder\Section->toRenderArray() (Line: 331)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildSections() (Line: 291)
Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay->buildMultiple() (Line: 340)
Drupal\Core\Entity\EntityViewBuilder->buildComponents() (Line: 282)
Drupal\Core\Entity\EntityViewBuilder->buildMultiple() (Line: 239)
Drupal\Core\Entity\EntityViewBuilder->build()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 886)
Drupal\Core\Render\Renderer->doCallback() (Line: 431)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 637)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 201)
Drupal\page_cache\StackMiddleware\PageCache->fetch() (Line: 138)
Drupal\page_cache\StackMiddleware\PageCache->lookup() (Line: 87)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 53)
Asm89\Stack\Cors->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)
This had been raised as 🐛 InvalidArgumentException: The array contains invalid values Active , but I think that in our case it's an issue with smart_date -
\Drupal\smart_date\Plugin\views\filter\Date::getMinAndMax doesn't catch the exception
1. create a view with min and max smart date filters
2. visit the view page with with a single quote within the query parameters for the value, e.g. ?changed%5Bmax%5D=%27&changed%5Bmin%5D=%27&custom_action=%27&order=%27&sort=%27
Catch the exception and display a message to the user
Active
4.2
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.