Skip to content
Snippets Groups Projects

Issue #3387544: Introduce opt-in configuration integrity validation

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
15 use Drupal\jsonapi_extras\ResourceType\NullJsonapiResourceConfig;
16
17 /**
18 * Makes sure that all resource config entities contain settings for all fields.
19 *
20 * This will avoid the use of default behavior when a field exists in an entity
21 * but there is no config about it. This typically happens when the field is
22 * added after the resource config was initially saved.
23 */
24 class FieldConfigIntegrityValidation extends ConfigImportValidateEventSubscriberBase {
25
26 public function __construct(
27 private ConfigManagerInterface $configManager,
28 private EntityTypeManagerInterface $entityTypeManager,
29 private ConfigurableResourceTypeRepository $resourceTypeRepository,
30 ) {}
  • 75 75 type: boolean
    76 76 label: 'Disabled by default'
    77 77 description: "If activated, all resource types that don't have a matching enabled resource config will be disabled."
    78 validate_configuration_integrity:
    79 type: boolean
    80 label: 'Validate configuration integrity'
    81 description: "Enable a configuration validation step for the fields in your resources. This will ensure that new (and updated) fields also contain configuration for the corresponding resources."
  • added 2 commits

    • b8a5eff7 - feat: add migration for config
    • ffbbea94 - fix: support deprecated PHP vertions

    Compare with previous version

  • Björn Brala
    Björn Brala @bbrala started a thread on commit b8a5eff7
  • 1 1 path_prefix: jsonapi
    2 2 include_count: false
    3 3 default_disabled: false
    4 validate_configuration_integrity: true
    • So with new installs this will be enabled? Is a little more agressive than we talked about. We talked about enabling by default in the next major (although who knows when that will be, maybe when 11 comes out).

      Although with the migration path for existing sites it might actually be a good idea i think.

    • Please register or sign in to reply
  • Björn Brala
    Björn Brala @bbrala started a thread on commit ffbbea94
  • 30 */
    31 private ConfigManagerInterface $configManager;
    32
    33 /**
    34 * The entity type manager.
    35 *
    36 * @var \Drupal\Core\Entity\EntityTypeManagerInterface
    37 */
    38 private EntityTypeManagerInterface $entityTypeManager;
    39
    40 /**
    41 * The resource type repository.
    42 *
    43 * @var \Drupal\jsonapi_extras\ResourceType\ConfigurableResourceTypeRepository
    44 */
    45 private ConfigurableResourceTypeRepository $resourceTypeRepository;
  • Björn Brala added 4 commits

    added 4 commits

    • 60bd18a0 - 1 commit from branch project:8.x-3.x
    • 0d9e6c54 - feat: introduce integrity validation for fields
    • b49b17cc - feat: add migration for config
    • eedf0444 - fix: support deprecated PHP vertions

    Compare with previous version

  • merged

  • Please register or sign in to reply
    Loading