let's not forget to use sdc_devel
pdureau â credited just_like_good_vibes â .
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
just_like_good_vibes â created an issue.
g4mbini â credited just_like_good_vibes â .
as discussed, we will merge stories form replaced component and replacer
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 :)
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
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 :)
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?
just_like_good_vibes â made their first commit to this issueâs fork.
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.
just_like_good_vibes â made their first commit to this issueâs fork.
just_like_good_vibes â created an issue.
just_like_good_vibes â made their first commit to this issueâs fork.
just_like_good_vibes â made their first commit to this issueâs fork.
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.
just_like_good_vibes â made their first commit to this issueâs fork.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
just_like_good_vibes â created an issue.
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
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.
let's go
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 :)
pdureau â credited just_like_good_vibes â .
i just added some tests to this MR.
if all tests are green, i will merge
i will merge that now
just_like_good_vibes â made their first commit to this issueâs fork.
pdureau â credited just_like_good_vibes â .
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
i need to check what is returned carefullyâŚ
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
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.
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.
@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 :)
nice catch, thank you
last issue before 1.1.0-RC-1 tag.
i will post code to this one soon, unless someone wants to do it?
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.
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;
}
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.
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
.
just_like_good_vibes â created an issue.
g4mbini â credited just_like_good_vibes â .
we wait for :
-
đ
Define form elements from SDC
Active
-
đ
Compatibility between SDC and the Form API
Active
let's check if this is still relevant now
hello, MR is red (phpmd) and also the tests need to be done after casting the values?
hello guys, i am currently writing a proposal we discussed a few weeks ago, i will ping you when it is ready for review :)
just_like_good_vibes â made their first commit to this issueâs fork.