Problem/Motivation

Currently, the module stores form modes in config in two different formats:

form_modes:
  'use  The form mode default linked to  media entity( image )': media.image.default
form_modes:
  creation+administrator+media+image: media.image.default
  modification+administrator+media+image: media.image.default

Not sure when exactly this was introduced, but it needs to be fixed. While we're at it, let's also simplify the config structure to not include these permission names.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dieterholvoet created an issue. See original summary.

dieterholvoet’s picture

Issue summary: View changes
sourav_paul’s picture

Checking..

dieterholvoet’s picture

Assigned: Unassigned » dieterholvoet

No need, I'm working on this.

dieterholvoet’s picture

If I understand correctly these permissions in the settings config ('use The form mode default linked to media entity( image )': media.image.default) aren't really necessary. The options in the second format (creation+administrator+media+image) determine the default form mode.

I removed the permission check from the defaults settings form. This is not necessary since defaults are always used without permission checks anyway. The project description reads this:

to define for each role, each bundle of each entity which form mode should be selected by default during the creation and edit of a content. Of course you should grant access before defining this.

But that granting access was never necessary, it was only done in the settings form but not when deciding what form mode should be used.

dieterholvoet’s picture

I refactored the biggest part of the module to make the code easier to understand. The config is now also in a simpler format and defaults are only written if the form mode is not the default one.

dieterholvoet’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • dieterholvoet committed c0258897 on 8.x-2.x
    Issue #3565648 by dieterholvoet: Fix configuration structure
    
dieterholvoet’s picture

Assigned: dieterholvoet » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.