Een hart voor de Drupal Community

Bij make it fly geloven we sterk in Drupal en Open Source software in het algemeen. We maken dagelijks gebruik van vele open source componenten en de vele Drupal modules die beschikbaar zijn. We dragen actief ons steentje bij aan de community door zelf patches, modules en documentatie te voorzien, daarnaast zijn enkele teamleden ook actief in de Drupal User Group vzw.

Een overzicht van onze bijdragen aan de Drupal community vind je terug op onze Drupal.org pagina. Naast het actief meerwerken aan de Drupal community, zetten we ook andere ontwikkelaars op weg door vragen te beantwoorden op Drupal Answers.

  1. Header is always shown in Claro even when regions in it are empty

    Fons

    Problem/Motivation

    The header of Claro is always rendered even when the regions (page.breadcrumb & page.header) are have no content in it.

    Because of this the background and the background color of the header is always rendered which is odd.

    Steps to reproduce

    Assign no content to the breadcrumb and header regions in Claro, you'll see the background is show on screen.

    Proposed resolution

    Add a check to see if one of the regions (breadcrumb or header) is filled, if not don't render the header at all.

  2. Error on disabling the "navigation_layout"

    Fons

    So for reasons beyond my control the "navigation_layout" seems to exist (core module navigation) and is something that is considered needed.

    If that's the case it would be best to alter this module so you can't disable it (since it will throw the error I mention).

    For now I disabled this module and disabled / hide the layouts with the following code in case somebody has the same problem as I do.

    In this example I hide all the layouts except the one col layout.

    /**
     * Implements hook_layout_alter().
     */
    function YOUR_MODULE_layout_alter(&$definitions)
    {
        // an array of layouts to keep.
        $layoutsWhitelist = ['navigation_layout'];
    
        // layouts that are required and cannot be removed.
        $requiredLayouts = ['layout_onecol', 'layout_builder_blank'];
    
        $layouts = array_merge($requiredLayouts, $layoutsWhitelist);
        
        $definitions = array_filter(
            $definitions,
            static fn(string $id) => in_array($id, $layouts, true),
            ARRAY_FILTER_USE_KEY
        );
    }
    
    /**
     * Implements hook_preprocess_item_list__layouts().
     */
    function YOUR_MODULE_preprocess_item_list__layouts(&$variables)
    {
        // For some reason removing this layout breaks the website so we hide it.
        $layoutToHide = ['navigation_layout'];
    
        $variables['items'] = array_filter(
            $variables['items'],
            static fn(string $id) => !in_array($id, $layoutToHide, true),
            ARRAY_FILTER_USE_KEY
        );
    }
    
  3. Error on disabling the "navigation_layout"

    Fons

    Problem/Motivation

    I disabled some layouts using this module which works fine.

    When hiding the navigation_layout an error is thrown:

    The website encountered an unexpected error. Try again later.
    
    Drupal\Component\Plugin\Exception\PluginNotFoundException: The "navigation_layout" plugin does not exist. Valid plugin IDs for Drupal\Core\Layout\LayoutPluginManager are: layout_onecol, layout_twocol_bricks, layout_threecol_25_50_25, layout_threecol_33_34_33, layout_builder_blank in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

    Seems like the navigation_layout does not exist but I do see it when using layout builder (see screenshots in attachment).

    Steps to reproduce

    Disable the navigation_layout

  4. TypeError_: unserialize(): Argument #1 ($data) must be of type string, array given in _unserialize()

    Randal

    Hi @mahde,

    Thanks for taking the time to debug and updating the MR! This brings us back to my comment in #5 though, there's only one piece of code in the module that updates the user data for roles, and it always serializes it.. I don't understand how it could possibly contain an array unless some other module messes with it 😓

  5. TypeError_: unserialize(): Argument #1 ($data) must be of type string, array given in _unserialize()

    Randal

    I'm sorry guys, I've tried debugging this but nothing seems to point to an error 😓

    Could you perhaps provide me with a list of contrib modules currently in use? That way I could test with those, maybe one of them triggers something malicious in msqrole.

    PS. I did fix some little bits here and there in the latest release, in the D11 compatible version there were some regressions, but none of which should have caused the main issue raised here. The "access denied" error you mentioned, @mahde, should be fixed though.

  6. Addition to readme for composer

    Fons

    Dear Duckydan

    Thank you for this suggestion, this would indeed improve the developer experience.

    I'll test this and add it the Readme after my vacation.

    Thank for your patience

    Fons

Sven Decabooter - Drupal Developer

"Onze teamleden bouwen zelf ook mee aan ons geliefde Drupal, en daar zijn we trots op"

Sven Decabooter
Drupal developer

Betrouwbare technologie, naadloze prestaties. Dat zijn onze Drupal-oplossingen.