🇮🇳India @vaibhavjain

Delhi
Account created on 9 February 2011, over 13 years ago
#

Recent comments

🇮🇳India vaibhavjain Delhi

@akshaykamble
If you are building the URL and migrating from 1.x to 3.x, you need to see your code.

$redirect_uri = Url::fromRoute(
          'openid_connect.redirect_controller_redirect',
          [
            'openid_connect_client' => $openid_connect_client,
          ],
          [
            'absolute' => TRUE,
            'language' => $language_none,
          ]
        )->toString(TRUE);

Change "client_name" to "openid_connect_client". The entity name has changed.

🇮🇳India vaibhavjain Delhi

Thank you for explaining things well @alexmoreno. I had same issue ( https://www.drupal.org/project/drupal/issues/2942975#comment-13341530 📌 [PP-1] Expose Layout Builder data to REST and JSON:API Postponed ), and hence added type and UUID fields to be output ( https://www.drupal.org/project/drupal/issues/2942975#comment-13361683 📌 [PP-1] Expose Layout Builder data to REST and JSON:API Postponed ). This lets me atleast build the JSON:API URL, which I can use to fetch the content of the components placed, via layout builder.
Yes, this was tested well with custom blocks and multiple block type, however never tried with fields from node or any other blocks from contrib modules.

IMO, we should be providing the relative link automatically, so that we can hit one specific key to fetch the content, than building a URL currently.

@geek-merlin I have verified this before, JSON:API includes does not work well here. Hence the route of adding more info to the output was taken.

🇮🇳India vaibhavjain Delhi

As the patch in #65 is incorrect, uploading the correct patch, with interdiff.

🇮🇳India vaibhavjain Delhi

The patch at #59 works well. I checked with JSON API output, and I am able to see the components there.
However I have a case, where I am not able to fetch the component content.

  1. Added a new node, with layout builder enabled per node.
  2. Added a new block type, text block.
  3. Added a new block content of type, text block.
  4. From Node, layout manager, add a new block of type text block and add a block that already exists.
  5. In the JSON API output, we cannot access content of Block, added via layout builder.

Question 1 - If we are exposing components, inside the layout, how do we plan to get content of each component ? There are no self or related links, to help you fetch the content and meta data of the component.
Question 2 - If all of the above is true, are we saying that, we can only access content of the block, which are not create via Layout Builder ?

I also see that JSONAPI, wont allow you to access the content of a block which is not reusable. A non Reusable block is created, when you add a block via Layout builder. However, this is also being worked upon here 2999491 →

Output of my JSON API

{
  "fda2e964-4a5e-4203-81ff-09954d1fb919": {
    "uuid": "fda2e964-4a5e-4203-81ff-09954d1fb919",
    "region": "first",
    "configuration": {
      "id": "inline_block:text_block",
      "label": "Non Reusable Block",
      "provider": "layout_builder",
      "label_display": "visible",
      "view_mode": "full",
      "block_revision_id": "2",
      "block_serialized": null,
      "context_mapping": []
    },
    "additional": [],
    "weight": 0
  },
  "f21a9758-3abe-4c96-8c60-53496fd31e42": {
    "uuid": "f21a9758-3abe-4c96-8c60-53496fd31e42",
    "region": "second",
    "configuration": {
      "id": "block_content:6255d80f-07e4-455e-bd47-f7a37fa9cee0",
      "label": "Reusable Block",
      "provider": "block_content",
      "label_display": "visible",
      "status": true,
      "info": "",
      "view_mode": "full",
      "context_mapping": []
    },
    "additional": [],
    "weight": 0
  }
}
Production build 0.69.0 2024