Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Component sources
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2025 at 15:09 UTC
Updated:
28 May 2025 at 10:49 UTC
Jump to comment: Most recent
Comments
Comment #2
isholgueras commentedI can't reproduce. It runs well for me in 0.x:
What I see is that I have this specific issue reproducible in 2 different unrelated builds that are not updated with 0.x at this time:
Comment #3
wim leers99% likely due to https://www.drupal.org/project/drupal/releases/11.1.7 having been released, and CI just having started using it by default.
Comment #4
longwaveReverting #3517317: SDC slots not being validated against json config schema fixes the test.
Comment #5
longwaveTo me though the strange thing is:
causes the error
[slots.test-slot] Array value found, but an object is requiredbutdoes not - @isholgueras suggests this may be due to json_encode() where an empty array is not converted to an object, but an associative array is.
If that is the case then just expecting the error on
>= 11.1.7seems wrong - instead we should fix this at the point of encoding if we can?Comment #6
wim leers+1
Comment #7
longwaveDid some debugging but we aren't really in control of that, and it's going to be hard to change.
Core's ComponentValidator does this:
Validator::arrayToObjectRecursive()is fromjustinrainbow/json-schema. I think we can probably argue that it is doing the right thing:It can't know at this point whether an empty array should stay as an empty array or be cast to an empty object - there are likely just as many cases where an empty array is correct here.
Also, because::arrayToObjectRecursive()works by encoding and decoding JSON, even if we force an emptyslotsto an object first, that is lost and it is cast back to an empty array.This is wrong, followup coming.
Comment #8
longwaveWe might want to raise this upstream and solve it in core in ComponentValidator, but we can fix this for us in
::toSdcDefinition():Comment #10
longwaveComment #11
wim leersAs soon as there's a core follow-up + our code pointing to it with a
// @todo Remove in <core issue URL>, this is IMHO ready to go 👍Epic digging, @longwave! 👏
Comment #14
tedbowI merged this as is because there some issues I think I would like to merge and I don't feel qualified to make the core follow-up. I would rather not merged the other issue with failing phpunit tests.
so setting back to Needs Work and assigning to @longwave to create another MR for the core follow-up link
Comment #15
wim leersGood call, @tedbow :) Thanks! 🙏
Comment #17
longwaveOpened #3524163: [regression] Empty slot definitions give incorrect validation message and linked it from a comment in MR!1026.
Comment #18
tedbowLooks good
Comment #20
tedbowComment #21
wim leersComment #22
penyaskito