Micon missing schema for its fields definitions

Created on 15 March 2024, 9 months ago
Updated 14 May 2024, 7 months ago

Problem/Motivation

In 📌 Fix invalid schema definition Postponed @Grevil found schema issues with Micon.

Looking into the schema I think the module is missing the schema definitions for its fields entirely!
The schema was first introduced in #3271002: Fix coding standards, add installation test and fix schema errors a while ago, but I think we didn't run into issues, because the fields were not set up and tested entirely combined with tests?

As Micon extends StringItem I guess we shouldn't define that part of the schema ourselves but inherit the string schema, if possible?
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/config/schema...

I think looking at the largest contrib field modules could speed things up:

Another option might be to unset these settings like written here: https://www.drupal.org/project/drowl_paragraphs_bs/issues/3428486#commen... 📌 Fix invalid schema definition Postponed if they are really not used and not useful!

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • 🇩🇪Germany Anybody Porta Westfalica
  • 🇩🇪Germany Anybody Porta Westfalica
  • First commit to issue fork.
  • 🇩🇪Germany Grevil

    Interestingly enough, config inspector AND the tests both won't show any schema errors... interesting.

  • 🇩🇪Germany Grevil

    No idea, the schema definition seems to be fine on micon's site.

    I tried redefining the storage definition using:

    field.storage_settings.micon_string:
      type: mapping
      label: 'Micon string settings'
      mapping:
        max_length:
          type: integer
          label: 'Maximum length'
        case_sensitive:
          type: boolean
          label: 'Case sensitive'
        is_ascii:
          type: boolean
          label: 'Contains US ASCII characters only'
    

    and "extending" it:

    field.storage_settings.micon_string:
      type: field.storage_settings.string
    

    similiar to https://git.drupalcode.org/project/entity_reference_revisions/-/blame/8....

    Nothing seems to work and neither the tests nor the config inspector throws any schema errors before or after the changes.

  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Did you set up such a field like the one that shows the error in the tests?

    My guess is, that this will first happen with a field set up?

  • Status changed to Needs review 9 months ago
  • 🇩🇪Germany Grevil

    Fixed, please review!

  • Merge request !31Resolve #3428592 "Micon missing schema" → (Merged) created by Anybody
  • Status changed to Needs work 9 months ago
  • 🇩🇪Germany Anybody Porta Westfalica

    @Grevil: Nice! I left two minor comments.
    But we shouldn't tag a release too soon with this change, I think. We need to be sure this has no side-effects.

    Also one hard part is left I guess: Removing the old config from existing installations?
    Perhaps you can find a snippet for that?

  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • 🇩🇪Germany Grevil

    Alright all done! Added an update hook as well, and it runs well and as expected:

    After the update, the field still works as expected and displays the given icon. Furthermore, no default_value is overriden or any other important field storage values.

  • 🇩🇪Germany Anybody Porta Westfalica

    Thanks @Grevil! LGTM! Still it's a heavy, but important change, so I'd like to have a sign-off by another maintaner who tested this.

    RTBC from my side.
    We should then wait with a new tagged release, once signed off and merged into dev, to see if this causes trouble somewhere.
    Thank you!

  • Assigned to jacobbell84
  • Issue was unassigned.
  • Status changed to Needs work 9 months ago
  • 🇩🇪Germany Grevil

    @Anybody found another schema error:

    content.field_symbol.settings.packages Undefined

  • Assigned to jacobbell84
  • Status changed to Needs review 9 months ago
  • 🇩🇪Germany Grevil

    Alright, should be fixed now, back to needs review.

  • Status changed to RTBC 8 months ago
  • 🇩🇪Germany Grevil

    I guess, @jacobbell84 is quite busy. I just ran into this issue again. As you RTBC'd this, I am just going to merge it. It was tested enough in my opinion.

  • Issue was unassigned.
  • Status changed to Fixed 8 months ago
    • Grevil committed 3cf3d3be on 2.x
      Hotfix: Adjust schema definition for "field.widget.settings.micon_string...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024