Closed (fixed)
Project:
Experience Builder
Version:
0.x-dev
Component:
Semi-Coupled theme engine
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Jan 2025 at 20:36 UTC
Updated:
7 Mar 2025 at 15:29 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
mglamanComment #4
roshni upadhyay commentedComment #5
roshni upadhyay commentedThe issue is with the API that when a node is updated, the updated content is not reflected in the API response. Instead, the API continues to return the old data. This problem occurs because the following code retrieves data from the auto-save manager, which may not have the latest changes:
Comment #10
wim leersDebugged this.
#5 is inaccurate AFAICT.
Debugging trail
nodewithstatus: false. Say, node 4./xb/node/4/editor. Observe that the toggle is toggled on.\Drupal\experience_builder\Controller\EntityFormController::form(). Observe this is the return value:Most importantly:
#value === FALSE.\Drupal\Core\Render\Element\Checkbox::preRenderCheckbox(), that's still the case.#return_valueForm API property to thevalueattribute:which results in
/ui/src/components/form/components/drupal/DrupalToggle.tsx. It contains this:… which appears accurate but isn't. The
valueattribute for<input type="checkbox">is very interesting 🤪, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox....So AFAICT the problem lies in
DrupalToggle, which was introduced in #3491265: Split form components into `Drupal`-prefixed behavioral wrappers and presentational components.Looking at
/node/<nid>/edit<input data-drupal-selector="edit-status-value" type="checkbox" id="edit-status-value" name="status[value]" value="1" class="form-checkbox form-boolean form-boolean--type-checkbox">👆 That's the markup being generated outside of XB. That's the starting point for things we do on top.
Tentative conclusion: needs only front-end changes?
So AFAICT updating
DrupalToggleshould work? Butdidn't do the trick 😅
I'm getting lost between:
ui/src/components/form/components/Checkbox.tsxui/src/components/form/components/drupal/DrupalInput.tsxui/src/components/form/components/Toggle.tsxui/src/components/form/components/drupal/DrupalToggle.tsx… because all four of those (!!!) are dealing with the
checkedattribute 😅 AFAICT only the last 2 are relevant. I changed both like indicated above, without success.I've done the due diligence, and think it's now down to somebody who knows the Semi-Coupled theme engine well enough to finish it up. It probably takes them only minutes given the digging I've done so far 🤞
Comment #11
wim leersComment #12
swarad07That should be the way, as the correct attribute to check should be
checkedand notvalueHowever, the other issue seems to be that the
attributes.checkedis coming astruealways.I am guessing somewhere in the flow that the
valueparameter of1is getting associated with thecheckedHTML attribute astrue.Needs further digging.
Comment #13
wim leersComment #14
balintbrewsI made an update to the
DrupalTogglecomponent in #3500017: Defining props for code components, then @jessebaker pointed me at this issue.Can someone, please, help me with steps to reproduce? We have solid investigation bits by Wim in #10, but I'm having a hard time to see how to actually reproduce the problem — unless it went away. (At the time of writing this comment, #3500017: Defining props for code components is not in, but I don't think that will fix this anyway.)
Comment #15
lauriii@balintbrews Added steps to the IS 😊
Comment #16
lauriiiAdding a gif
Comment #17
wim leersAdded STR for using article nodes.
Comment #18
roshni upadhyay commentedI have made some changes in
ui/src/components/form/components/inputBehaviors.tsx, which have resolved the checkbox issue. The autosave state is now updating correctly. However, still facing a problem when moving a node from published to draft.Comment #21
jessebaker commentedThanks, merged!