Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-136: Adds '#description_display' => 'before' to avoid warning #137

Merged
merged 2 commits into from
Nov 9, 2022

Conversation

DiegoPino
Copy link
Member

See #136

We are not even using #description but seems like #description_display IS required. Will test more

We are not even using #description but seems like #description_display IS required. Will test more
@DiegoPino DiegoPino requested a review from aksm November 9, 2022 02:13
@DiegoPino DiegoPino added bug Something isn't working External Bug It is not my fault (anonymous Geologist) Drupal 9 Future is here. why? labels Nov 9, 2022
@DiegoPino DiegoPino added this to the 0.5.0 milestone Nov 9, 2022
@aksm
Copy link
Contributor

aksm commented Nov 9, 2022

@DiegoPino Still seeing the warning here in my logs. Taking a closer look at the code now.

@DiegoPino
Copy link
Member Author

Please share the warnings when you can. Might be also that the form is still cached?

@aksm
Copy link
Contributor

aksm commented Nov 9, 2022

Seeing the below after clearing cache:

Warning: Undefined array key "#description_display" in template_preprocess_form_element() (line 486 of /var/www/html/web/core/includes/form.inc)

@DiegoPino
Copy link
Member Author

Yes, but there is more, look at the rest of the message, that is where it fails but not the controller/our code that triggers it

@aksm
Copy link
Contributor

aksm commented Nov 9, 2022

Sorry, here's the full warning:

Warning: Undefined array key "#description_display" in template_preprocess_form_element() (line 486 of /var/www/html/web/core/includes/form.inc)
#0 /var/www/html/web/core/includes/bootstrap.inc(347): _drupal_error_handler_real(2, 'Undefined array...', '/var/www/html/w...', 486)
#1 /var/www/html/web/core/includes/form.inc(486): _drupal_error_handler(2, 'Undefined array...', '/var/www/html/w...', 486)
#2 [internal function]: template_preprocess_form_element(Array, 'form_element', Array)
#3 /var/www/html/web/core/lib/Drupal/Core/Theme/ThemeManager.php(287): call_user_func_array('template_prepro...', Array)
#4 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(478): Drupal\Core\Theme\ThemeManager->render('form_element', Array)
#5 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Render\Renderer->doRender(Array)
#6 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(435): Drupal\Core\Render\Renderer->doRender(Array)
#7 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(201): Drupal\Core\Render\Renderer->doRender(Array, true)
#8 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(145): Drupal\Core\Render\Renderer->render(Array, true)
#9 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(564): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#10 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(146): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#11 /var/www/html/web/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php(36): Drupal\Core\Render\Renderer->renderRoot(Array)
#12 /var/www/html/web/core/lib/Drupal/Core/Ajax/OpenDialogCommand.php(135): Drupal\Core\Ajax\OpenDialogCommand->getRenderedContent()
#13 /var/www/html/web/core/lib/Drupal/Core/Ajax/OpenOffCanvasDialogCommand.php(66): Drupal\Core\Ajax\OpenDialogCommand->render()
#14 /var/www/html/web/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\OpenOffCanvasDialogCommand->render()
#15 /var/www/html/web/modules/contrib/ami/src/Controller/AmiRowAutocompleteHandler.php(401): Drupal\Core\Ajax\AjaxResponse->addCommand(Object(Drupal\Core\Ajax\OpenOffCanvasDialogCommand))
#16 [internal function]: Drupal\ami\Controller\AmiRowAutocompleteHandler::ajaxPreviewAmiSet(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request))
#17 /var/www/html/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array('\\Drupal\\ami\\Con...', Array)
#18 /var/www/html/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array)
#19 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#20 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(142): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#21 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(219): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Symfony\Component\HttpKernel\Event\ExceptionEvent), 'kernel.exceptio...')
#22 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\Component\HttpKernel\HttpKernel->handleThrowable(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1)
#23 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(709): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#32 {main}

@aksm
Copy link
Contributor

aksm commented Nov 9, 2022

@DiegoPino I've narrowed it down to line 280-281:

            '#description' => t('This data structure will contain the original values (before modification) of an ADO only when updating. Sadly we can not at this time preview it during an AMI set preview.'),
            '#rows' => 60,

If I add the #description_display there, the warning goes away:

            '#description' => t('This data structure will contain the original values (before modification) of an ADO only when updating. Sadly we can not at this time preview it during an AMI set preview.'),
            '#description_display' => 'before',
            '#rows' => 60,

@DiegoPino
Copy link
Member Author

ha! so I missed one!

Good catch. Will fix. Thanks!

@aksm wonder if we need to do a whole inspection. We might have this in other places too. I will open a larger issue and do that. So strange Code Mirror requires this too! Thanks

Co-Authored-By: Albert Min <albert.min@gmail.com>
@aksm aksm merged commit 6f83eba into 0.5.0 Nov 9, 2022
@DiegoPino DiegoPino deleted the ISSUE-136 branch November 9, 2022 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Drupal 9 Future is here. why? External Bug It is not my fault (anonymous Geologist)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined array key "#description_display" in Ami Row Preview Controller
2 participants