Account created on 13 January 2008, over 17 years ago
#

Merge Requests

More

Recent comments

🇫🇷France goz

modules/display_builder_entity_view/fixtures/default_entity_view.yml is empty.
Should be removed ?

🇫🇷France goz

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

🇫🇷France goz

It's not so easy.

The twig is called when the display builder is loaded. Contextual islands are not loaded yet,and no contextual island plugin is loaded.
Islands Plugins are loaded once an instance is triggered, but only plugins are updated, not the contextual area.

Events seem to be triggered on islands plugins, not on the contextual area.

I look forward, but may be someone with more knowledge about how display_builder works has an idea ?

🇫🇷France goz

Everything is green except css lint. Yipee !

I take a look on ResetButton and we are good

🇫🇷France goz

Why did you add IslandPluginFormTrait to ResetButton?

You are right, i miss this one.
It's a plugin, i should add plugin form logic here to.

Instead of adding $current_island_id on onUpdate() method, is there an other way of passing the data? Ideally, this MR will only alter the 4 island plugins with forms.

Unfortunatelly not, or may be using another static service...

🇫🇷France goz

@nod_ can you be more specific when you talk about "unusual things" so we can fix it ?

🇫🇷France goz

After MR, active link in gin toolbar :

And not active :

And finally default toolbar :

🇫🇷France goz

In the MR, i remove dashboard-active.svg part since mask automatically change color on active links.

🇫🇷France goz

Yes you are right.
As you can see, i want to have a configurable field group form with an icon.
Icon widget output is complex data which needs to be manipulated to be stored.

🇫🇷France goz

It's a performance solution, but, in my opinion, a bad thing for UX.
The idea is still great, may be we can find something to solve UX.

UX issue:
It's a button, we are not used to have a button in a form to display a select list / other options to configure switch a field. If i saw this button, i will don't know why it's here and what is its purpose. It's not intuitive.

Proposal:
1/ May be we could add some things with this button so we understand it's a default source and we can change it. May be adding an arrow inside the button, at right like a select list does ?
2/ Be more verbose, with text AND a button : <span>Current source : URL</span><button>Change source</button>

🇫🇷France goz

Sorry, i have a lot to do those days.

I'll take a loot at your proposal (and will take time to review the 3.x compatibility)

🇫🇷France goz

Nice, it works !

Agreed to rename token source, but replacing Token by String, we are missing the "token" feature.
May be something with both ?
"String and token" ?

🇫🇷France goz

My bad, you are right, adjustments are cleared and recalculated. I forgot that. Checked again and everything is fine

🇫🇷France goz

With last patch, no error is thrown, i can list adjustments for orders and order items, but i cannot create them.

GET /jsonapi/commerce_order/default?filter[drupal_internal__order_id]=3807'

{
    "jsonapi": {
        "version": "1.0",
        "meta": {
            "links": {
                "self": {
                    "href": "http://jsonapi.org/format/1.0/"
                }
            }
        }
    },
    "data": [
        {
            "type": "commerce_order--default",
            "id": "ad15f584-05f7-43a8-bd55-ab18a4eaba2c",
            "links": {
...
            },
            "attributes": {
                "drupal_internal__order_id": 3807,
                "order_number": "3807",
...
                "adjustments": [
                    {
                        "type": "shipping",
                        "label": "Expédition",
                        "amount": {
                            "number": "4.95",
                            "currency_code": "EUR",
                            "formatted": "4,95 €"
                        },
                        "percentage": null,
                        "source_id": "1058",
                        "included": false,
                        "locked": false
                    }
                ],
                "total_price": {
                    "number": "28.950000",
                    "currency_code": "EUR",
                    "formatted": "28,95 €"
                },
                "total_paid": null,
                "balance": {
                    "number": "28.950000",
                    "currency_code": "EUR",
                    "formatted": "28,95 €"
                },
                "state": "completed",
                "locked": false,
                "created": "2025-03-14T08:13:38+00:00",
                "changed": "2025-03-14T13:53:41+00:00",
                "placed": "2025-03-14T13:53:41+00:00",
                "completed": "2025-03-14T13:53:41+00:00",
                "customer_comments": null,
                "cart": false,
                "checkout_step": "complete",
...
            },
            "relationships": {
...
            }
        }
    ],
...
}

But creating new order doesn't :

{
    "data": {
        "type": "commerce_order_item--abonnement_single",
        "attributes": {
                            "title": "Abonnement individuel - 1 an",
                            "quantity": "1.00",
                            "unit_price": {
                                "number": "15.000000",
                                "currency_code": "EUR",
                                "formatted": "15,00 €"
                            },
                            "total_price": {
                                "number": "15.000000",
                                "currency_code": "EUR",
                                "formatted": "15,00 €"
                            },
                            "adjustments": [
                                {
                                    "type": "tax",
                                    "label": "TVA",
                                    "amount": {
                                        "number": "0.31",
                                        "currency_code": "EUR"
                                    },
                                    "percentage": "0.021",
                                    "source_id": "france|0|0",
                                    "included": true
                                }
                            ]
        },
        "relationships": {
            "uid": {
                "data": {
                    "type": "user--user",
                    "id": "565a095e-d398-4ebb-9030-f877d9301601"
                }
            },
            "order_id": {
                "data": {
                    "type": "commerce_order--default",
                    "id": "f1fe4660-dba4-4c90-8c0e-4090310a1e78"
                }
            },
            "store_id": {
                "data": {
                    "type": "commerce_store--online",
                    "id": "1adc9d7c-c976-4951-9cd4-38413b150a51"
                }
            },
            "purchased_entity": {
                "data": {
                    "type": "commerce_product_variation--abonnement_single",
                    "id": "e12569c7-24a4-4a5c-844f-d67ea1e01a21"
                }
            }

        }
    }
}

Result :

{
    "jsonapi": {
        "version": "1.0",
        "meta": {
            "links": {
                "self": {
                    "href": "http://jsonapi.org/format/1.0/"
                }
            }
        }
    },
    "data": {
        "type": "commerce_order_item--abonnement_single",
        "id": "cea7ce7c-84c2-4154-85b6-e65c87bf233c",
        "links": {
...
        },
        "attributes": {
            "drupal_internal__order_item_id": 5932,
            "title": "Abonnement individuel - 1 an",
            "overridden_title": false,
            "quantity": "1",
            "unit_price": {
                "number": "15.000000",
                "currency_code": "EUR",
                "formatted": "15,00 €"
            },
            "overridden_unit_price": false,
            "total_price": {
                "number": "15.00",
                "currency_code": "EUR",
                "formatted": "15,00 €"
            },
            "adjustments": [],
            "uses_legacy_adjustments": false,
            "data": null,
            "locked": false,
            "created": "2025-05-16T10:34:03+00:00",
            "changed": "2025-05-16T10:34:03+00:00"
        },
..
}

Same thing creating order_item.

🇫🇷France goz

Part of this issue should be first done by field_group module since the module has the same issue.
Allow to massage form settings values Active

🇫🇷France goz

FYI, when layout builder was configured on default view mode, i had to add the first section from the edit form, because paragraph layout edition link was not displaying.
There is definitively an issue when layout builder is configured on default view mode

🇫🇷France goz

i find a workaround :

  1. Configure default node display without layout builder and set widget with nesting_depth to 10.
  2. Add full content view mode and configure it with layout builder.

Now, i can add nested sections. When i want to add the nested section, i guess it can find the settings from the no-layout builder default view mode

🇫🇷France goz

I confirm this work without using layout builder to build my node page

🇫🇷France goz

If i use the edit form, everything works fine.
Issue is only when i want to edit sections from the node display

🇫🇷France goz

Looks great.
What's about a test to confirm props attributes will keep its values in case keys exist in both.

    $build = [
      '#type' => 'component',
      '#component' => 'sdc_theme_test:my-card',
      '#props' => [
        'header' => 'Drupal.org',
        'attributes' => new Attribute([
          'foo' => 'bar',
        ]),
      ],
      '#attributes' => [
        'foo => 'third',
      ],
    ];

I think in this case, foo should still be bar.

And what's about attribute with array like classes for example ?

    $build = [
      '#type' => 'component',
      '#component' => 'sdc_theme_test:my-card',
      '#props' => [
        'header' => 'Drupal.org',
        'attributes' => new Attribute([
          'foo' => ['bar', 'ter'],
        ]),
      ],
      '#attributes' => [
        'foo' => ['quater'],
      ],
    ];
🇫🇷France goz

Issue has been followed to mondial relay development team.

Without news, i'll commit this, waiting a fix from the library.

🇫🇷France goz

Same issue for me.

#1 Option does not download library.

#2 Option load library but name folder is northernco--ckeditor5-anchor-drupal.

Adding in installer-paths the mapping solve the issue as explained in #31.
Warning, it has to be added before web/libraries/{$name}

    "extra": {
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ],
        "installer-paths": {
(...)
            "web/libraries/ckeditor5-anchor-drupal": [
                "npm-asset/northernco--ckeditor5-anchor-drupal"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ]
        },

Remove first the library before changes, then require it again.

composer remove npm-asset/northernco--ckeditor5-anchor-drupal
# Make changes in composer.json in sntaller-paths
composer require npm-asset/northernco--ckeditor5-anchor-drupal
🇫🇷France goz

Thanks to put widget back.
Glad to see we are moving to MapItem, good job !

I still have an issue, but we are almost there !

With my layout paragraph, i have a field storage for components (props & variant).
When i create my paragraph, content is stored correctly.
When i edit my paragraph, preview is good, but saving loose changes.

🇫🇷France goz

Sad to see widget disappear while it was working in previous commits :(

I think you are right @pdureau, MapItem could do the job BUT we have to be sure it do the job without having to tweak it and it does not seem to be really used

🇫🇷France goz

Something is wrong with the last commits, my submission is not stored anymore in field. FYI, i also use last commit from https://www.drupal.org/i/3511027

🇫🇷France goz

Weight of fields is different between configuration and display.

In configuration :

In display :

🇫🇷France goz

Thanks @Christian, i miss that.

MR has to be rebased

🇫🇷France goz

@Christian, i think you miss my comment #6

🇫🇷France goz

Hi Christian. Good work on this !
I have an issue installing this module.
Looks like something is missing in entity type configuration, which do config_translation module complain.

[10-Mar-2025 09:14:07 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getPath() on null in /var/www/html/web/core/modules/config_translation/src/ConfigNamesMapper.php:247
Stack trace:
#0 /var/www/html/web/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
#1 /var/www/html/web/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection))
#2 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))

Adding definition of edit_form in routing file fixes it


entity.sdc_component_form_display.edit_form:
  path: '/admin/structure/component/{sdc_component_id}/form-display/{form_mode_name}/edit'
  defaults:
    _entity_form: 'sdc_component_form_display.edit'
    _title: 'Edit a component display'
  requirements:
    _permission: 'administer sdc_component_form_display'
🇫🇷France goz

goz changed the visibility of the branch 3.0.x to hidden.

🇫🇷France goz

#89 works with 3.0 but use previous fix based on "Any".
MR add the adjustmentType which should be kept for 3.0

🇫🇷France goz

But we should also support denormalizer implementing DenormalizerInterface and adding denormalize method, so we can create order item with adjustment from jsonapi.


  /**
   * {@inheritdoc}
   */
  public function denormalize($data, $type, $format = NULL, array $context = []) {
    if (isset($context['field_type']) && 'commerce_adjustment' === $context['field_type']) {
      if (isset($data['amount'], $data['amount']['number'], $data['amount']['currency_code'])) {
        $data['amount'] = new Price($data['amount']['number'], $data['amount']['currency_code']);
      }
      return new Adjustment($data);
    }

    return $data;
  }
🇫🇷France goz

Hi, i have the same issue using ui_suite_bootstrap + layout_paragraphs + mercury_editor

In node edition with paragraph layout, start a new paragraph, choose a component (+ button), add your section paragraph in the first dialog, second dialog opened and error is logged in console

🇫🇷France goz

My bad, the module was in a strange state. This does not match with 5.1.x version.

Production build 0.71.5 2024