PARIS
Account created on 26 April 2010, about 15 years ago
#

Merge Requests

More

Recent comments

🇫🇷France just_like_good_vibes PARIS

let's not forget to use sdc_devel

🇫🇷France just_like_good_vibes PARIS

we are maybe not ready yet, but we are taking a specific direction, that would be good to validate the direction :)
for example for props being array of attributes

🇫🇷France just_like_good_vibes PARIS

as discussed, we will merge stories form replaced component and replacer

🇫🇷France just_like_good_vibes PARIS

We will probably use empty string for the value of "source_id", to allow the source selector to appear.
but, in the future, more functionalities may be introduced to control what is shown.

We are ok that this change allows to show the source selector, and it is for site builders :)

🇫🇷France just_like_good_vibes PARIS

As we discussed,
it would be better to have two new methods in the decorated sdc service, to be able to get SortedDefinitions and getGroupedDefinitions with replacements.

we need nice names :)

🇫🇷France just_like_good_vibes PARIS

Hello,
just to add some information about the current implementation, i am questioning here the way it is done,
in comparison to the code in SystemMenuBlock::build

we could use menuTree->getCurrentRouteMenuTreeParameters(,
any thoughts?

🇫🇷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

i am still hesitant because the bug seems triggered by the usage of ui_patterns_ui, and we are trying to fix it in ui_patterns.

🇫🇷France just_like_good_vibes PARIS

Hello,
this bug is also appearing in another particular context :
you define a slot, which should implicitly be an array of items. It is used in twig as an array of items.

When you map - with the component form of ui patterns - some data into this particular slot (in my case with a [Entity]->referended [Entity] source), you can be blocked because when you save the form, the sample entity may contains only one value, so you are injecting an array of size one, but that array is then reduced by the code pinpointed in that issue. And then the twig of component is mis-behaving, treating a single item as an array of items... and exception could occur, preventing to save the component form!
So another reason to push this fix.

As we discussed with Christian, we made the choice to keep the weird code already there but we added more control before apply the change, this allows to avoid edge cases.

and the fix is working for the case i just described here, also the case described by christian.

To say more about the weird code i mentioned, it is helping to inject arrays in slots. Indeed, sometimes you want slot to be of a certain "format", in other words you will use a slot as a container for a sequence of items (renderables). To inject an array with UI, you usually use component form, you select a source to be used for the first item in a slot, and that source is returning an array of values. Users usually expect that array to be injected in the slot and not [0 => the_array] as it is naturally the case. So because slot values are render arrays, we reduce single keyed-render arrays to allow the array to be at root level. This is done without loosing rendering information. But unfortunately we were not covering well all possible cases. now it's better.

🇫🇷France just_like_good_vibes PARIS

we postpone this one, some notes :

- we won't make a new component, but we will upgrade the footer component
- still not sure about how to model the input.
- in the docs the style prop is not a good news.
- probably we will model the input with arrays, the first element(s) of array(s) would be the main partner. we won't separate main and sub partners in input
- footer related classes have to be injected into a and img tags, so we won't allow slots, rather a prop-based solution

🇫🇷France just_like_good_vibes PARIS

Hello @yannickoo and thank you for the tip.
Indeed, we target something similar to what Embedded Content is doing, but first we are trying to have no contrib dependencies.
We will anyway discuss that potential dependency with others from the team.
We have already ckeditor5 implementations in ui_styles an ui_icon module, so we can add one here.

🇫🇷France just_like_good_vibes PARIS

hello, sorry i am stepping in this one.
usually the test to know if an entity is a sample entity, is to test the id of that entity which is empty/null, not the isNew method :)

🇫🇷France just_like_good_vibes PARIS

i just added some tests to this MR.
if all tests are green, i will merge

🇫🇷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

hello,
after a small discussion, it appears the needs should be addressed with a custom source, that would make the data extraction as needed and return the appropriate data

🇫🇷France just_like_good_vibes PARIS

i need to check what is returned carefully…

🇫🇷France just_like_good_vibes PARIS

we could mention the token capabilities in the description and keep string as source name.
but, be careful, tokens can return renderables, yes they are like UFOs right? so string may not be accurate.
let’s check that, maybe i am wrong

🇫🇷France just_like_good_vibes PARIS

Hello juc1, thank you for this kind message ;)
we will soon propose a tiny update to this part of doc, if a small mistake has been made by someone.
we don’t want any misunderstanding, indeed ckeditor integration had been planned for 2.1, and not for 2.0.

🇫🇷France just_like_good_vibes PARIS

the fix here is correcting the reproduction of the bug i made in lab, but after some testing, it does not solve yet my real world initial problem.
those “bad”
sample values are quite a big problem compared the assumptions we made. maybe we are not taking the problem in the right sense. the real problem here, is that sometimes, some sample entities do not have values in referenced entities, because those samples are not real samples, they are real entities borrowed. to cover our needs here and fill the gap, we only need random entities where they are missing. if we could identify, through a conext or whatever, that the current entity in the context is a sample, then we could fill that gap more easily than trying to patch every sample entity.

🇫🇷France just_like_good_vibes PARIS

@christian, as we discussed today, here is a better implementation of sample entity generator,
getting rid of peace of real contents in entity reference fields.
Please note :
- i carefully cleaned in the case of layout builder generated entity or when we generate an entity with our generator
- we clean recursively, because yes it's required... that's why we only traverse some fields, and the configurable ones to be more precise. When i let the base fields, the traversal goes crazy everywhere... especially the author fields, picture..etc and in cascade.
- it fixes the bug i managed to reproduce in the lab today :)

🇫🇷France just_like_good_vibes PARIS

last issue before 1.1.0-RC-1 tag.
i will post code to this one soon, unless someone wants to do it?

🇫🇷France just_like_good_vibes PARIS

first issue is done in 🐛 [1.1.0] check nav_menu fold/unfold Active

for the second issue, we postpone for later (1.1.x branch).

Custom scenarios require now custom code. We will sort out later, on how to do it without coding.

🇫🇷France just_like_good_vibes PARIS

Ok, now i think i have it .

We have a serious bug inside our code, because we were supposing sample entities to be really sample, without an id.
and this is false in the case of some entity reference fields, because of that code in \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::generateSampleValue

   // Select a random number of references between the last 50 referenceable
    // entities created.
    if ($referenceable = $selection_handler->getReferenceableEntities(NULL, 'CONTAINS', 50)) {
      $group = array_rand($referenceable);
      $values['target_id'] = array_rand($referenceable[$group]);
      return $values;
    }
🇫🇷France just_like_good_vibes PARIS

The problem is in this code from the SampleEntityGenerator.

$entity = $tempstore->get("$entity_type_id.$bundle_id")

the entity in there is not the supposed random entity.

🇫🇷France just_like_good_vibes PARIS

More investigations : the buggy entity ( that is supposed to be a random entity but it's not) is already there in layout builder.
We got it from LayoutBuilderContextEntityResolver::guessLayoutBuilderEntity.

🇫🇷France just_like_good_vibes PARIS

hello, MR is red (phpmd) and also the tests need to be done after casting the values?

🇫🇷France just_like_good_vibes PARIS

hello guys, i am currently writing a proposal we discussed a few weeks ago, i will ping you when it is ready for review :)

🇫🇷France just_like_good_vibes PARIS

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

Production build 0.71.5 2024