- Issue created by @joseph.olstad
- 🇨🇦Canada web247 Toronto
I can look into the phpstan issues for toc_api and push for a tagged release, if that helps.
- 🇨🇦Canada joseph.olstad
@web247 yes that would help immensely!
Thank you!
- 🇨🇦Canada joseph.olstad
Great, @danrod fixed all the phpstan errors and now the automated tests are passing for toc_api!
Thanks @web247!
- 🇨🇦Canada web247 Toronto
We will look into the 4 remaining test issues for the layout_builder_st today. @danrod
- 🇨🇦Canada web247 Toronto
We will look into the 4 remaining test issues for the layout_builder_st today. @danrod
- 🇨🇦Canada smulvih2 Canada 🍁
There is an issue I discovered today, affecting both 5.4.x and 6.1.x. The issue prevents an image upload using the Entity Browser field widget. The error comes from wxt_ext_media:
getCurrentEntity() failed: No valid media entity found.
TypeError: Cannot assign array to property Drupal\file\Plugin\Validation\Constraint\FileExtensionConstraint::$extensions of type string in Symfony\Component\Validator\Constraint->__construct() (line 133 of /var/www/vendor/symfony/validator/Constraint.php).
The issue seems to start here - https://github.com/drupalwxt/wxt/blob/f1e6ab364f2dc56cec811c39de40eb15a8e8bdbf/modules/custom/wxt_ext/wxt_ext_media/src/Plugin/EntityBrowser/Widget/EntityFormProxy.php#L98
At this point, $form_state seems to only have reference to the tab instance and no field values.
To reproduce, add an image field to a content type, using the Entity browser field widget. Then add/modify a node and use the Upload tab in the Entity Browser dialog, see the issue.
- 🇨🇦Canada web247 Toronto
I tried replicate your issue but I had no luck, but I got another issue when trying to add an image from the Entity Browser:
Did you also see that?
This is what I am seeing in the DBlog table:
Warning: Undefined variable $edit_button_access in Drupal\entity_browser\Plugin\Field\FieldWidget\FileBrowserWidget->displayCurrentSelection() (line 335 of /var/www/html/html/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/FileBrowserWidget.php) #0 /var/www/html/html/core/includes/bootstrap.inc(108): _drupal_error_handler_real() #1 /var/www/html/html/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/FileBrowserWidget.php(335): _drupal_error_handler() #2 /var/www/html/html/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php(415): Drupal\entity_browser\Plugin\Field\FieldWidget\FileBrowserWidget->displayCurrentSelection() #3 /var/www/html/html/modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/FileBrowserWidget.php(146): Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget->formElement() #4 /var/www/html/html/core/lib/Drupal/Core/Field/WidgetBase.php(459): Drupal\entity_browser\Plugin\Field\FieldWidget\FileBrowserWidget->formElement() #5 /var/www/html/html/core/lib/Drupal/Core/Field/WidgetBase.php(101): Drupal\Core\Field\WidgetBase->formSingleElement() #6 /var/www/html/html/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(197): Drupal\Core\Field\WidgetBase->form() #7 /var/www/html/html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(121): Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm() #8 /var/www/html/html/core/modules/node/src/NodeForm.php(138): Drupal\Core\Entity\ContentEntityForm->form() #9 /var/www/html/html/core/lib/Drupal/Core/Entity/EntityForm.php(107): Drupal\node\NodeForm->form() #10 [internal function]: Drupal\Core\Entity\EntityForm->buildForm() #11 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(528): call_user_func_array() #12 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(370): Drupal\Core\Form\FormBuilder->retrieveForm() #13 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(625): Drupal\Core\Form\FormBuilder->rebuildForm() #14 /var/www/html/html/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm() #15 /var/www/html/html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm() #16 /var/www/html/html/core/modules/layout_builder/src/Controller/LayoutBuilderHtmlEntityFormController.php(39): Drupal\Core\Controller\FormController->getContentResult() #17 [internal function]: Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult() #18 /var/www/html/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array() #19 /var/www/html/html/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /var/www/html/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext() #21 /var/www/html/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() #22 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #23 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #24 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle() #25 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #26 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #27 /var/www/html/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle() #28 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\big_pipe\StackMiddleware\ContentLength->handle() #29 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #30 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #31 /var/www/html/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle() #32 /var/www/html/html/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle() #33 /var/www/html/html/index.php(19): Drupal\Core\DrupalKernel->handle() #34 {main}
- 🇨🇦Canada web247 Toronto
And I don't see anything in the searchs results regarding this issue, I'll try reproducing the issue in other instances.
- 🇨🇦Canada web247 Toronto
It's strange, I am getting a different error in my Drupal.11.1.1 instance:
The website encountered an unexpected error. Try again later. TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 424 of modules/contrib/entity_browser/src/Plugin/Field/FieldWidget/EntityReferenceBrowserWidget.php). Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget::processEntityBrowser() call_user_func_array() (Line: 1010) Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073) Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073) Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073) Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 571) Drupal\Core\Form\FormBuilder->processForm() (Line: 321) Drupal\Core\Form\FormBuilder->buildForm() (Line: 73) Drupal\Core\Controller\FormController->getContentResult() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183) 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: 116) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90) Drupal\page_cache\StackMiddleware\PageCache->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: 709) Drupal\Core\DrupalKernel->handle() (Line: 19)
- 🇨🇦Canada smulvih2 Canada 🍁
Ok I found the solution to my issue reported above about the Entity Browser's Upload function. The error occurred when passing an array of file extensions to the validate() method, when it expects a string. This has been fixed in 5.4.x in
wxt_ext_media/src/Element/Upload.php
. I will push this fix to the 6.1.x branch tomorrow after doing some more tests on 5.4.x.Change: https://github.com/drupalwxt/wxt/commit/35732d056a0de75fb208f810ada6c441e149da87
- 🇨🇦Canada web247 Toronto
@danrod's changes for the layout_builder_st were rejected, so we are in the same position as we are in the first place, is there a similar module we can use?
Or perhaps creating a new one with less features but enough for what we need to release Wxt 6.1.0 D11
https://www.drupal.org/project/layout_builder_st/issues/3497945#comment-... 📌 Make coding standards fixes Active
If there are lots of tests that are failing, it means that this module was poorly written in the first place.
- 🇨🇦Canada smulvih2 Canada 🍁
Ya it's too bad core doesn't include this functionality, seem pretty important to have translations for layout builder blocks:
"This module provides the ability to translate the block labels and inline blocks that are added in the Layout Builder."
- 🇨🇦Canada joseph.olstad
Our option is to either follow exactly @phenaproximas requests or to fork layout_builder_st completely into a new project namespace.
I believe phenaproxima is ok with us commenting out the 4 tests however wants it done with a specific explanation in the comments and a followup issue. He's available on Slack to discuss with.
He left some suggestions, none of which rang any bells for me but I believe that we could convince him to move forward hopefully by resolving some of his concerns / comments. With that said, perhaps time to fork as we would like to cut a release in the next month or so.
- 🇨🇦Canada joseph.olstad
Use chrome to see the comments, Firefox will not load them for some reason
https://www.drupal.org/project/layout_builder_st/issues/3497945 📌 Make coding standards fixes Active
- 🇨🇦Canada web247 Toronto
The issue is that many of the tests that are failing are the ones that translate the block labels, for example in the file
tests/src/FunctionalJavascript/TranslationTest.php
after line 115:// Update the translations block label. $this->drupalGet('it/node/1/layout'); $this->assertNonTranslationActionsRemoved(); $this->updateBlockTranslation('.block-system-powered-by-block', 'untranslated label', 'label updated in translation', 'label in translation'); */ /* TOFIX:$assert_session->buttonExists('Save layout'); $page->pressButton('Save layout'); $assert_session->addressEquals('it/node/1'); $assert_session->pageTextContains('label updated in translation'); $assert_session->pageTextNotContains('label in translation');
so basically the module is not working at all or some patches need to be applied before fixing the tests.
I'll go for forking a light version of this.
- 🇨🇦Canada joseph.olstad
I spoke with @phenaproxima on Slack, preparing layout_builder_st as discussed with him.
- 🇨🇦Canada joseph.olstad
One down, one to go:
https://www.drupal.org/project/toc_api/releases/2.0.0 →
Next is lightning_builder_st , praying that phenaproxima goes ahead with some sort of a move forward. A branch, or even just a merge to dev.