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. Variation cache error when enabling the "domain"-module.

    Randal

    Problem/Motivation

    When enabling the core "Navigation" module and contributed "Domain" module, I seem to run into this error:

    The complete set of cache contexts for a variation cache item must contain all of the initial cache contexts, missing: user.site
    

    I saw in the cache contexts that the exact ones listed in the default value of the container parameter `render.config:required_cache_contexts` were used, but when looking at the NavigationRenderer, they're hardcoded into it. If I replace the hardcoded contexts list on line 133 in the NavigationRenderer:

    $build[$delta]['#cache']['contexts'] = ['user.permissions', 'theme', 'languages:language_interface'];
    

    With this code:

    $renderer_config = \Drupal::getContainer()->getParameter('renderer.config');
    $build[$delta]['#cache']['contexts'] = $renderer_config['required_cache_contexts']
      ?? ['user.permissions', 'theme', 'languages:language_interface'];
    

    Then it seems to work (since I've added `user.list` as a required context in my services file).

    Steps to reproduce

    - Start on an empty Drupal 11 website - Enable the Navigation and Domain modules

    Proposed resolution

    I think, using the container parameter renderer.config:required_cache_contexts instead of the hardcoded list: - user.permissions - theme - languages:language_interface

    Should be fine? Unless I completely misunderstand this functionality.

  2. Render logs and overview as templates rather than inline render arrays/html

    Randal

    Problem/Motivation

    Currently, in the FilesLogController, the overview of logs and canonical log pages are built completely in the controller with inline render arrays and inline templates. Ideally this should just follow the Drupal way of using templates.

    Proposed resolution

    Rework the controller to render only templates that can be overridden elsewhere.

  3. How can I GET/POST flag user by REST API in Drupal 8 or higher

    Randal

    I had encountered a bug in a react application (embedded in Drupal on the same domain) that for anonymous users, no session id was present. I found the functionality where this was set and extended it slightly, this should correctly set the session id if it's ever missing.

    I also fixed the core version requirement I had mentioned before.

    The tests are still needed though, leaving status as-is.

  4. Abstract token usage

    Bram Goffings

    At the moment the token usage can't be found on streamed responses. Any guidance would be helpfull...

    See: https://www.drupal.org/project/ai_provider_openai/issues/3519302#comment...

  5. Abstract token usage support

    Bram Goffings

    I tested this and this doesn't crash anymore with the latest changes. But it also doesn't support streams as it doesn't contain the need info.

    :(

  6. Allow selection of which features to activate

    Sven Decabooter

    I created a MR to add this functionality. For the selectable prefill attributes for form elements I didn't add an option, as this needs to be configured per field widget manually anyway, AFAIK.

    Attached is also a patch version of the MR changes, for Composer based workflows.

  7. Allow selection of which features to activate

    Sven Decabooter

    Problem/Motivation

    To improve flexibility for people using this module, it would be good to allow the option to disable some of the features this module provides (although probably not recommended).

    For example, one could choose to disable the HTML5 validation that is added to all forms, and selectively decide which forms can have HTML5 validation (e.g. Webform module already provides a toggle for this - which is overridden by this module).

    Proposed resolution

    Provide a configuration schema and settings page to select which features to enable (defaults to everything enabled).

    Remaining tasks

    Create a MR with this functionality

    User interface changes

    An extra settings page would be added. No other UI changes needed.

    API changes

    /

    Data model changes

    /

  8. Translation of config actions

    Sven Decabooter

    That looks like a great approach to add translation options to recipes.

    I don't have strong feelings regarding the exact syntax, but personally prefer the options where the parameters are named explicitly (so 2nd or 3rd).

    I'm assuming the 3rd could also be written as

       form:
          '#type': email    
          '#title': !translate { 
            string: 'Feedback form email address', 
            context: 'Third context' 
          }
    

    As it would avoid having everything on 1 line, especially with larger strings you would need to do some horizontal scrolling in your IDE. Come to think of it, then I probably prefer the 2nd version, as it avoids the extra brackets as well..

  9. Similar module - co-maintaining and merging?

    Sven Decabooter

    Thanks for the notice. Since this module has more usage and already has some releases, I think it would make sense to deprecate your module, and provide its extra functionalities in this module. I'd be happy to review merge requests to get extra functionality in.

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.