PARIS
Account created on 26 April 2010, over 14 years ago
#

Merge Requests

More

Recent comments

🇫🇷France just_like_good_vibes PARIS

For Display suite users, one can look at the solution shown in that issue 📌 Compatibility with UI patterns 2 Active . It will be implemented in the future in ui_patterns_ds module.

🇫🇷France just_like_good_vibes PARIS

we found the solution.

one needs to implement


function ui_patterns_ds_preprocess_ds_entity_view(&$variables) {
   if (isset($variables['content']) && isset($variables['content']['#entity']) && isset($variables['content']['#source_contexts'])
      && is_array($variables['content']['#source_contexts']) && !isset($variables['content']['#source_contexts']["entity"])) {
    $variables['content']['#source_contexts']["entity"] = \Drupal\Core\Plugin\Context\EntityContext::fromEntity($variables['content']['#entity']);
  }
}
🇫🇷France just_like_good_vibes PARIS

expect an answer and new version very soon, within minutes :)

🇫🇷France just_like_good_vibes PARIS

just_like_good_vibes made their first commit to this issue’s fork.

🇫🇷France just_like_good_vibes PARIS

For the moment, let's catch context exceptions and send a message to drupal logs...

🇫🇷France just_like_good_vibes PARIS

Thanks for reporting.
After investigation, this error occurs when using the contrib module ds, when a layout from ui patterns is configured in a content entity display (here a paragraph), and in the layout settings, a source with the current entity is used.
it works in form configuration, but fails to properly render.
Indeed, for the moment, ui_patterns module is not providing itself a way to guess the current entity inside ds_entity_view layout options.

🇫🇷France just_like_good_vibes PARIS

hello, i will take the current work and adds some tests for it

🇫🇷France just_like_good_vibes PARIS

hello, do we need to add some tests for it ? i can make it just in case, let me know.

🇫🇷France just_like_good_vibes PARIS

for me, work as expected right now.

🇫🇷France just_like_good_vibes PARIS

maybe this should be configurable in the field formatter?

🇫🇷France just_like_good_vibes PARIS

ok, i fixed it.
i also added a phpunit test.

🇫🇷France just_like_good_vibes PARIS

Hello,
i will take back this issue and publish the fix.

🇫🇷France just_like_good_vibes PARIS

here we go :) normalization of slot, a new add-on. Stronger than before :D

🇫🇷France just_like_good_vibes PARIS

or maybe just a core bug...
see Drupal\Core\Render\Element::isRenderArray called from ComponentElement::generateComponentTemplate, line 112. the line Element::isRenderArray($slot_value) is generating the error.

🇫🇷France just_like_good_vibes PARIS

This is an horrible SDC bug...
there is a complex render array generated by the comments block, without any comments.

At a certain depth in the render array, there an an empty array as the value of key "comments".
empty arrays are not considered render arrays, and the whole array structure is then considered not being a render array,
and SDC fails with WSOD.

i propose to create a workaround for that case in ui_patterns, but that's clearly not our role.
We will help users, to keep protected from SDC being too strict :(

🇫🇷France just_like_good_vibes PARIS

@grimreaper, would you try something for me ?

in the src/Element/ComponentSlotForm.php, in function buildComponentDropbutton (around line 400),
add a first line return $elements;.

Then it seems everythings works, could you confirm please?

🇫🇷France just_like_good_vibes PARIS

please add more details to the usecase, not very clear how to reproduce :)

🇫🇷France just_like_good_vibes PARIS

Yes, because in fact, no matter which block is used in Layout builder, as soon as we have a slot (for example in a component block in LB), and the dropdown button to add a source, it does not work anymore.
If i desactiveate the dropdown button, and repace it to a list of buttons, then ajax works again.

so the problem you encountered is clearly related to how dropdown are handled here in ui_suite_bootstrap.
Maybe we are not constructing well the dropdown ? i don't have the final answer yet

🇫🇷France just_like_good_vibes PARIS

just a question, i am not sure about it : would it be related to how dropdown buttons are managed in bootstrap?

🇫🇷France just_like_good_vibes PARIS

Please note, it seems it is not happening with theme ui_suite_dsfr for example.

🇫🇷France just_like_good_vibes PARIS

looks ok for merge. then i just rebased to prepare merge

🇫🇷France just_like_good_vibes PARIS

let's note, we clean the data for normalization but not everything.

🇫🇷France just_like_good_vibes PARIS

- we need a comment into the convert to indicates normalization will clean bad strings

- update noramlization to clean properly

🇫🇷France just_like_good_vibes PARIS

ok, seen during the weekly

we will deprecate the "HTML class source", still usable the same way.

but, the recommended source is Attributes, and the processing of the value is more elaborate.
we check if "=" sign is inside the value,
- if yes : in the attributes string format
- otherwide : a list of classes

so validation and getPropValue are changing for the better :)

let's update also the default source

🇫🇷France just_like_good_vibes PARIS

i don't know why it's for me, i send it back to christian :)

🇫🇷France just_like_good_vibes PARIS

i added a few minor changes.
and removed the unwanted tests. please review Christian :)

🇫🇷France just_like_good_vibes PARIS

we need to address this more carefully, the initial work posted by sourav_paul did not carefully check for existing attributes in the tags.

Production build 0.71.5 2024