Paragraph Blocks don't seem to work with Layout Builder Browser

Created on 28 August 2023, 10 months ago
Updated 29 August 2023, 10 months ago

Problem/Motivation

This module doesn't seem to work with the Layout Builder Browser module . Not sure if the issue is on Paragraph Blocks end or on Layout Builder Browser end. If Paragraph Blocks module is enabled, I can't add any blocks whatsoever into Layout Builder Browser and get JavaScript errors in the console. If I don't have Paragraph Blocks enabled, I can add blocks freely to Layout Builder Browser.

This is the error I'm getting in the browser console in Firefox:

Uncaught 
Object { message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/config/content/layout-builder-browser/blocks/add?blockcat=my_components\nStatusText: OK\nResponseText: ", name: "AjaxError", stack: "@http://MY-DOMAIN.com/core/misc/ajax.js?v=9.5.10:92:32\n@http://MY-DOMAIN.com/core/misc/ajax.js?v=9.5.10:642:3\n" }

I'm also getting this error in dblog which may be related:

Error: Call to a member function getPluginId() on null in Drupal\paragraph_blocks\ParagraphBlocksEntityManager->getRefererEntity() (line 93 of /home/username/MY_DOMAIN/web/modules/contrib/paragraph_blocks/src/ParagraphBlocksEntityManager.php)

Steps to reproduce

  1. Install Paragraph Blocks and create paragraphs on a content type as needed to be exposed as paragraph blocks.
  2. Test that the paragraph blocks are working within Layout Builder correctly.
  3. Install Layout Builder Browser via Composer/Drupal UI.
  4. Go to /admin/config/content/layout-builder-browser/categories and create an initial block category.
  5. Go to /admin/config/content/layout-builder-browser and click the "Place block" button next to your block category; nothing happens. Check browser console for error message.
🐛 Bug report
Status

Needs work

Version

3.1

Component

Code

Created by

🇺🇸United States dalemoore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @dalemoore
  • Assigned to viren18febS
  • 🇮🇳India viren18febS

    Checking the issue!

  • Issue was unassigned.
  • Status changed to Needs review 10 months ago
  • 🇮🇳India viren18febS

    Hi @dalemoore
    I have added a patch file for above issue & screenshot for your reference.

  • Status changed to RTBC 10 months ago
  • 🇺🇸United States dalemoore

    Gotta love those one-line fixes! 100% working now for me. Thanks @viren18febS!

  • Status changed to Needs work 10 months ago
  • 🇺🇸United States dalemoore

    Actually, sorry, I spoke too soon. While this fixes the ability to "place block" with Block Paragraphs installed/enabled, you can't actually place any paragraph blocks with Layout Builder Browser except "globally"... so while you can pick from some existing Paragraph Blocks at /admin/config/content/layout-builder-browser (see screenshot), it can't be done on a node-by-node basis where it will show whatever paragraphs have been created for that node in the browser. It doesn't use the admin title at all, either. This probably requires some extra code to integrate PB with LBB. Not sure if that's something the maintainers are interested in.

Production build 0.69.0 2024