Issues with the "Form mode manager" module

Created on 12 June 2023, almost 2 years ago

Problem/Motivation

Form mode manager โ†’ module allows to edit entities on different from modes.
It seems to have some issues when used with the gin theme:
- The "Show/Hide sidebar panel" functionality seems broken. The sidebar is under the form.
- Some from elements have white background when using the dark theme.

Steps to reproduce

Proposed resolution

1 Explain how to integrate the sidebar into a custom form.
2 Explain why .entity-meta__header remains white on dark gin theme.
3 Improve gin css selectors if possible
4 Move the ticket to form_mode_manager with the explanation

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

๐Ÿ‡ญ๐Ÿ‡บHungary pasqualle ๐Ÿ‡ญ๐Ÿ‡บ Budapest

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

Merge Requests

Comments & Activities

  • Issue created by @pasqualle
  • ๐Ÿ‡ญ๐Ÿ‡บHungary pasqualle ๐Ÿ‡ญ๐Ÿ‡บ Budapest

    It seems implementing hook_gin_content_form_routes() solves the problem.

    Please register all the new routes with this hook.

    As a quick workaround, the hook can be used in a custom module as:

    function mymodule_gin_content_form_routes() {
      return [
        'entity.node.edit_form.myformmode',
      ];
    }
    
  • First commit to issue fork.
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update almost 2 years ago
    Not currently mergeable.
  • @chester_ opened merge request.
  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly kopeboy Milan

    Thank you, this works while editing entities, but there is still a problem when using /node/add-list/[CUSTOM_FORM_MODE] (which is problematic on its own and I'm trying to get rid of anyway, at least of the button links at /admin/content ๐Ÿ˜‡

  • Status changed to Active 12 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly kopeboy Milan
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany luenemann Sรผdbaden, Germany

    I came up with this:

      $route_match = Drupal::routeMatch();
      if ($route_match->getRouteObject()->hasOption('_form_mode_manager_entity_type_id') && !str_starts_with($route_match->getRouteName(), 'form_mode_manager.')) {
        return [$route_match->getRouteName()];
      }
      return [];
    }
    
  • First commit to issue fork.
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    tim-diels โ†’ changed the visibility of the branch 3.x to hidden.

  • Merge request !20Add Gin compatibility โ†’ (Open) created by tim-diels
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    Added the code from the latest comment as a MR as this worked for me.

Production build 0.71.5 2024