Remove Layout Library dependency on Field UI

Created on 2 February 2024, 8 months ago
Updated 6 February 2024, 8 months ago

Problem/Motivation

It is considered a best practice to disable UI module Field UI on production. However, since Layout Library has a dependency on Field UI, it makes it impossible to adjust layout created with Layout Library and keep Field UI disabled on production.

Steps to reproduce

  1. Disable Field UI module
  2. Access to layout library configuration from admin/structure/layouts

Proposed resolution

Rewrite Layout Library so that layouts can be created/edited when Field UI is enabled, but can still be used (although not created/edited) when Field UI is disabled (for example, on production).

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇲🇦Morocco afaouki

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

Comments & Activities

  • Issue created by @afaouki
  • 🇲🇦Morocco afaouki

    Corrective Patch remove Layout Library dependency on FieldUI::getRouteBundleParameter() method

  • 🇲🇦Morocco afaouki

    /**
    * Implements hook_menu_links_discovered_alter().
    */
    function mymodule_menu_links_discovered_alter(&$links) {
    // Check if Field UI module is enabled.
    if (!\Drupal::moduleHandler()->moduleExists('field_ui')) {
    // If Field UI is not enabled, remove the layout library link.
    unset($links['entity.layout.collection']);
    }
    }

Production build 0.71.5 2024