PHP: 7.1.1 / XAMPP
Core: 8.5.4
Ctools: 8.x-3.0
Module: Ctools-Views

Since Update to 8.x-3.0 I get the following warning when editing a views block type:

Warning: array_filter() expects parameter 1 to be array, null given in Drupal\ctools_views\Plugin\Display\Block->buildOptionsForm() (Zeile 55 in D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php) #0 D:\xampp\htdocs\myproject\core\includes\bootstrap.inc(582): _drupal_error_handler_real(2, 'array_filter() ...', 'D:\\xampp\\htdocs...', 55, Array) #1 [internal function]: _drupal_error_handler(2, 'array_filter() ...', 'D:\\xampp\\htdocs...', 55, Array) #2 D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php(55): array_filter(NULL) #3 D:\xampp\htdocs\myproject\core\modules\views_ui\src\Form\Ajax\Display.php(74): Drupal\ctools_views\Plugin\Display\Block->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState)) #4 [internal function]: Drupal\views_ui\Form\Ajax\Display->buildForm(Array, Object(Drupal\Core\Form\FormState)) #5 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\Form\FormBuilder.php(518): call_user_func_array(Array, Array) #6 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\Form\FormBuilder.php(275): Drupal\Core\Form\FormBuilder->retrieveForm('views_ui_edit_d...', Object(Drupal\Core\Form\FormState)) #7 D:\xampp\htdocs\myproject\core\modules\views_ui\src\Form\Ajax\ViewsFormBase.php(214): Drupal\Core\Form\FormBuilder->buildForm('views_ui_edit_d...', Object(Drupal\Core\Form\FormState)) #8 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\Render\Renderer.php(582): Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}() #9 D:\xampp\htdocs\myproject\core\modules\views_ui\src\Form\Ajax\ViewsFormBase.php(216): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #10 D:\xampp\htdocs\myproject\core\modules\views_ui\src\Form\Ajax\ViewsFormBase.php(125): Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState)) #11 D:\xampp\htdocs\myproject\core\modules\views_ui\src\Form\Ajax\Display.php(46): Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm(Object(Drupal\views_ui\ViewUI), 'block_1', 'ajax') #12 [internal function]: Drupal\views_ui\Form\Ajax\Display->getForm(Object(Drupal\views_ui\ViewUI), 'block_1', 'ajax', 'pager_options') #13 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #14 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\Render\Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #16 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #17 D:\xampp\htdocs\myproject\vendor\symfony\http-kernel\HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #18 D:\xampp\htdocs\myproject\vendor\symfony\http-kernel\HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #19 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\StackMiddleware\Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\StackMiddleware\KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 D:\xampp\htdocs\myproject\core\modules\page_cache\src\StackMiddleware\PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 D:\xampp\htdocs\myproject\core\modules\page_cache\src\StackMiddleware\PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #23 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\StackMiddleware\ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #24 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\StackMiddleware\NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #25 D:\xampp\htdocs\myproject\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #26 D:\xampp\htdocs\myproject\core\lib\Drupal\Core\DrupalKernel.php(666): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #27 D:\xampp\htdocs\myproject\index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #28 {main}.

and:

Notice: Undefined index: #default_value in Drupal\ctools_views\Plugin\Display\Block->buildOptionsForm() (Zeile 55 in D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php) #0 D:\xampp\htdocs\myproject\core\includes\bootstrap.inc(582): _drupal_error_handler_real(8, 'Undefined index...', 'D:\\xampp\\htdocs...', 55, Array) #1 D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php(55): _drupal_error_handler(8, 'Undefined index...', 'D:\\xampp\\htdocs...', 55, Array) #2 ....

and:

Notice: Undefined index: allow in Drupal\ctools_views\Plugin\Display\Block->buildOptionsForm() (Zeile 46 in D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php) #0 D:\xampp\htdocs\myproject\core\includes\bootstrap.inc(582): _drupal_error_handler_real(8, 'Undefined index...', 'D:\\xampp\\htdocs...', 46, Array) #1 D:\xampp\htdocs\myproject\modules\ctools\modules\ctools_views\src\Plugin\Display\Block.php(46): _drupal_error_handler(8, 'Undefined index...', 'D:\\xampp\\htdocs...', 46, Array) #2 ....

I uninstalled CTOOLS VIEWS and no further messages.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ksc created an issue. See original summary.

saurabh.dhariwal’s picture

FileSize
763 bytes

@ksc, I review the issue you mentioned above, Please refer my patch which removes all the warnings & errors related to this module issue.

Please share your views if you still face the same issue.

Thanks!.

saurabh.dhariwal’s picture

Status: Active » Needs review
ksc’s picture

@saurabh.dhariwal, thanks. It seems to be ok. No further notices or warnings.

andrey.troeglazov’s picture

Made it more readable and with short array.

joelpittet’s picture

Version: 8.x-3.0 » 8.x-3.x-dev
Status: Needs review » Fixed

Thanks @andrey.troeglazov and @saurabh.dhariwal, I've committed this to the dev branch

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.