- Issue created by @gauravvvv
- Assigned to gauravvvv
- ๐ฎ๐ณIndia gauravvvv Delhi, India
In the Components prop editor, some required fields donโt have values, which is why the error occurs.
- Status changed to Postponed: needs info
4 months ago 5:39am 14 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Did you git pull and then reinstall XB using the documented steps?
Tests are passing, and the tests explicitly test those steps.
- ๐ฎ๐ณIndia gauravvvv Delhi, India
I am facing this on a fresh install, also when I am trying to upload an image then I get an error:
TypeError: str_starts_with(): Argument #1 ($haystack) must be of type string, null given in str_starts_with() (line 255 of /var/www/html/modules/experience_builder/src/Plugin/Field/FieldWidget/TwoTerribleTextAreasWidget.php).
here is the Stack trace
#0 /var/www/html/modules/experience_builder/src/Plugin/Field/FieldWidget/TwoTerribleTextAreasWidget.php(255): str_starts_with() #1 /var/www/html/core/lib/Drupal/Core/Field/WidgetBase.php(505): Drupal\experience_builder\Plugin\Field\FieldWidget\TwoTerribleTextAreasWidget->massageFormValues() #2 /var/www/html/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(244): Drupal\Core\Field\WidgetBase->extractFormValues() #3 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(334): Drupal\Core\Entity\Entity\EntityFormDisplay->extractFormValues() #4 /var/www/html/core/lib/Drupal/Core/Entity/EntityForm.php(301): Drupal\Core\Entity\ContentEntityForm->copyFormValuesToEntity() #5 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(155): Drupal\Core\Entity\EntityForm->buildEntity() #6 /var/www/html/core/lib/Drupal/Core/Entity/ContentEntityForm.php(186): Drupal\Core\Entity\ContentEntityForm->buildEntity() #7 [internal function]: Drupal\Core\Entity\ContentEntityForm->validateForm() #8 /var/www/html/core/lib/Drupal/Core/Form/FormValidator.php(82): call_user_func_array() #9 /var/www/html/core/lib/Drupal/Core/Form/FormValidator.php(274): Drupal\Core\Form\FormValidator->executeValidateHandlers() #10 /var/www/html/core/lib/Drupal/Core/Form/FormValidator.php(118): Drupal\Core\Form\FormValidator->doValidateForm() #11 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(585): Drupal\Core\Form\FormValidator->validateForm() #12 /var/www/html/core/lib/Drupal/Core/Form/FormBuilder.php(321): Drupal\Core\Form\FormBuilder->processForm() #13 /var/www/html/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm() #14 [internal function]: Drupal\Core\Controller\FormController->getContentResult() #15 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array() #16 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(593): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #17 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext() #18 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() #19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(183): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #21 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle() #22 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #23 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #24 /var/www/html/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle() #25 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\big_pipe\StackMiddleware\ContentLength->handle() #26 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass() #27 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #28 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #29 /var/www/html/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #30 /var/www/html/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle() #31 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(709): Drupal\Core\StackMiddleware\StackedHttpKernel->handle() #32 /var/www/html/index.php(19): Drupal\Core\DrupalKernel->handle() #33 {main}
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I need the exact steps to reproduce, because I cannot reproduce this ๐ซ
Are you doing these steps that are in
CONTRIBUTING.md
?# See it in action + recommended development environment 1. Drupal 11 (preferably a git clone, for git archeology โ 10.3 will work too). 2. `composer require drush/drush` 3. `drush si standard` 4. `drush pm:install experience_builder` 5. Browse to `/node/add/article` โ you'll see a `๐ช XB Demo โจ` field. Don't touch that โ just enter a title for the article and hit save: a component is rendered using the article title ๐ค 6. If you're curious: look at the code, step through it with a debugger, and join us! 7. If you want to run *all* tests locally, including the OpenAPI spec one: `composer require league/openapi-psr7-validator webflo/drupal-finder devizzent/cebe-php-openapi --dev`
- ๐ฎ๐ณIndia gauravvvv Delhi, India
Hi @wim leers, Yes I am following the same steps. Here is the screenshots for same.
Drupal standard installation
Image upload in hero field
Database log for the error
- ๐ฎ๐ณIndia imalabya Bangalore
@gauravvvv Try uploading an image with a simpler file name like
banner.jpeg
That will work@Wim Leers Images with spaces in the file like
Filename here.jpg
will throw the error. However, this works on a normal image field - ๐ฎ๐ณIndia imalabya Bangalore
The Image field throws the below error for images with Spaces in the filename.
Exception: [src] Invalid URL format in Drupal\experience_builder\Plugin\Adapter\AdapterBase->validateConformanceToJsonSchemaType() (line 68 of /var/www/html/web/modules/experience_builder/src/Plugin/Adapter/AdapterBase.php).
- Status changed to Active
4 months ago 8:39am 16 August 2024 - ๐ซ๐ฎFinland lauriii Finland
- ๐ฎ๐ณIndia abhisekmazumdar India
Oh, I did remember facing this issue, but a fresh setup with 11.x and using a different image made it work. However, I understand that it is related to how the image is named.
- ๐ณ๐ฟNew Zealand siramsay
I can reproduce this too. I am using 10.3.2 and a git clone of the xb repo.
I don't understand this bit
Browse to `/node/add/article` โ you'll see a `๐ช XB Demo โจ` field. Don't touch that โ just enter a title for the article and hit save: a component is rendered using the article title
Mainly because we need to add the required image.
I have tried an image named image,jpg after reading this and the problem persists.What I can notice is there are a lot of required fields like the one below.
These disable the save button.If I select something I CAN "save" the node.
But then getting hero field is required.Upload an image and get Ops....
- ๐ณ๐ฟNew Zealand siramsay
Follow up / fresh installation d11
I get the same log as #4
This is the browser console when upload an image named one.jpg or a.jpg (keeping names short for reason above.)
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
I pair-debugged this with @lauriii, because I could not reproduce this.
- Determining the root cause for the
str_starts_with()
error (full stack trace: #4) is not worth it โ we should just get rid ofTwoTerribleTextAreasWidget
now that A) enough of the XB PoC UI is working, B) ๐ HTTP API: update /xb-component/{component_id} to list possible prop sources for current entity context Fixed will surface the available choices.It is out of scope for ๐ฑ Milestone 0.1.0: Experience Builder Demo Active to support
dynamic prop sources
(see https://git.drupalcode.org/project/experience_builder/-/blob/0.x/docs/da...), and designs for that do not exist yet.Conclusion: simply delete
TwoTerribleTextAreasWidget
, which implicitly means making the XB field's tree structure non-editable, because the XB PoC UI does not yet support saving. This is fine, because the UX of that widget was โฆ terrible anyway (and even intentionally so). The default value inconfig/optional/field.field.node.article.field_xb_demo.yml
will continue dictating the tree structure for now. - Once that was fixed, we ran into a subsequent problem, which @siramsay reported in #11. Debugging led to the root cause: the SDC subsystem in Drupal core has a critical bug with not detecting duplicate plugin IDs, resulting in a race condition/environment-specific behavior. Created
๐
ComponentPluginManager should detect if an extension provides two different components that resolve to the same plugin ID
Active
for that.
XB is triggering that bug since ๐ Introduce an example set of representative SDC components; transition from "component list" to "component tree" Fixed , because it introducedcomponents/simple/image/image.component.yml
in addition to the pre-existingcomponents/image/image.component.yml
๐คช For now, update the former to use the schema of the latter, but add a@todo
to update the schema to the simpler form.
- Determining the root cause for the
- Assigned to wim leers
- Merge request !177#3467972: Unable to save node article form โ remove obsolete TwoTerribleTextAreasWidget + fix duplicate `XB:image` SDC โ (Merged) created by wim leers
- Issue was unassigned.
- Status changed to Needs review
4 months ago 1:56pm 19 August 2024 - ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
Opened ๐ Update XB's `image` SDC to comply with best practices, and document those best practices Needs review for #13.2.
- Assigned to tedbow
-
Wim Leers โ
committed f3667563 on 0.x
Issue #3467972 by Wim Leers, gauravvvv, siramsay, imalabya, lauriii:...
-
Wim Leers โ
committed f3667563 on 0.x
- Issue was unassigned.
- Status changed to Fixed
4 months ago 4:04pm 19 August 2024 - ๐ฌ๐งUnited Kingdom f.mazeikis Brighton
Wim Leers โ credited f.mazeikis โ .
- ๐ง๐ชBelgium wim leers Ghent ๐ง๐ช๐ช๐บ
@f.mazeikis DM'd me telling me he ran into problems with the
experience_builder:image
component. So I pointed him to the fix here โฆ and that's why he reviewed it and it's now in ๐Retroactively tagging , because this was blocking ๐ Auto-create/update Component config entities for all discovered SDCs that meet XB's minimum criteria Fixed .
Automatically closed - issue fixed for 2 weeks with no activity.