Configuration schema for "Enable extra settings" (title,pagination,...) incorrect

Created on 16 November 2023, 11 months ago
Updated 17 May 2024, 4 months ago

Problem/Motivation

config schema errors.

Steps to reproduce

create a custom ViewsReference Setting
config schema erorrs are visable in field.field.paragraph.view.field_view_reference when viewing Configuration inspector

Proposed resolution

replace

enabled_settings:
      type: sequence
      label: 'Enabled settings'
      sequence:
      type: viewsreference.enabled_settings.[%key]

with:

    enabled_settings:
      type: sequence
      label: 'Enabled settings'
      sequence:
        type: integer
πŸ› Bug report
Status

Fixed

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands perry.franken

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

Comments & Activities

  • Issue created by @perry.franken
  • πŸ‡³πŸ‡±Netherlands perry.franken

    A created a path for this issue.

  • πŸ‡³πŸ‡±Netherlands perry.franken

    changed it to string:

  • πŸ‡¦πŸ‡ΉAustria hudri Austria

    For people looking for a fix to the "display title" option, this patch here makes that option work again.

  • Status changed to RTBC 9 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    1 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 9 months ago
    1 pass
  • πŸ‡¦πŸ‡ΉAustria hudri Austria
  • πŸ‡¦πŸ‡ΉAustria hudri Austria
  • πŸ‡ΊπŸ‡ΈUnited States redeight

    As hudri said, the patch fixes an issue we're having with using these options on our sites.

  • πŸ‡³πŸ‡±Netherlands ricovandevin

    I can confirm that before applying the patch from #4 the options 'limit', 'offset' and 'title' could not be enabled (their values in the config were set to 0) and after applying this patch they can be enabled (again).

  • πŸ‡¨πŸ‡¦Canada Sseto

    Confirm #4 fixes my issue too!

  • πŸ‡ΊπŸ‡¦Ukraine paulrad

    Hi, guys!
    Shouldn't there be some update function to make those changes applicable to the current users?

  • πŸ‡¦πŸ‡ΉAustria hudri Austria

    Due this bug it is not possible to activate those options, so I don't think an update hook could reliably fix this.

  • πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

    Add one more RBTC for me: patch #4 is simple but does the trick.

    You do have to go back and re-set views reference fields that were changed by this issue (created or edited after upgrade to beta 7), and that's likely going to be a case-by-case process, so it doesn't seem suitable for an update hook.

  • Status changed to Needs review 7 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 5.7
    last update 7 months ago
    1 pass
  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Ass the patch stands, it leaves cruft in the configuration schema. The way the schema was developed, they were adding a separate entry for each plugin. Obviously that's no longer correct, so lets do the type string sequence AND remove the definitions for the individual settings.

  • Status changed to RTBC 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

    Patch #14 doesn't change the config output in my case (no cruft for us) but it continues to work for me. Changing back to RBTC.

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    For reference, the schema doesn't control what's exported in config management explicitly, it just tells config management what to expect in the config.yml files. In this case, since the last patch did this:

           type: sequence
           label: 'Enabled settings'
           sequence:
    -        type: viewsreference.enabled_settings.[%key]
    +        type: string
    

    That means that viewsreference.enabled_settings.[%key] is no longer used, therefore the entries in the schema that were created for this are no longer needed, therefore my addition of

    @@ -54,26 +54,6 @@ field.value.viewsreference:
           type: string
           label: 'Serialized data'
     
    -viewsreference.enabled_settings.argument:
    -  type: string
    -  label: 'Argument settings'
    -
    -viewsreference.enabled_settings.limit:
    -  type: integer
    -  label: 'Limit results settings'
    -
    -viewsreference.enabled_settings.offset:
    -  type: integer
    -  label: 'Offset results settings'
    -
    -viewsreference.enabled_settings.pager:
    -  type: string
    -  label: 'Pagination settings'
    -
    -viewsreference.enabled_settings.title:
    -  type: boolean
    -  label: 'Include View Title settings'
    -
     viewsreference.plugin_types:
       type: sequence
       label: 'View display plugins to allow'
    

    to the patch. It's simply to clean up unused links in the configuration schema that are now unused.

  • πŸ‡ΊπŸ‡ΈUnited States daletrexel Minnesota, USA

    Thanks, @generalredneck! I wasn't 100% certain whether or not your removal of those entries would have impacts to users' configurations too, whether exported before or after the update that broke things.

    Also, it gave me the chance to confirm that the updated patch had been reviewed and tested good enough for my purposes!

  • patch #14 fixes my issue thanks !

  • πŸ‡ΊπŸ‡ΈUnited States liberatr Portland, OR

    For me, this patch was not working until I manually edited my config file and reimported. Example below:

    field.field.paragraph.events.field_event_list.yml:
    (For your own field, you will have to find the "field.field.[entity].field_name" that's relevant to you)
    (this is just the last 15 or so lines of the file)

    ...
    settings:
      handler: 'default:view'
      handler_settings:
        target_bundles: null
        auto_create: false
      plugin_types:
        block: block
      preselect_views: {  }
      enabled_settings:
        limit: limit
        offset: offset
        title: title
        pager: pager
        argument: argument
    field_type: viewsreference
    

    ...where the old incorrect values were:

      enabled_settings:
        limit: 1
        offset: 1
        title: true
        pager: pager
        argument: argument
    
    • ea1ea74c committed on 8.x-2.x
      Issue #3402036 by perry.franken, generalredneck, hudri, DaleTrexel,...
  • Status changed to Fixed 6 months ago
  • πŸ‡³πŸ‡±Netherlands seanB Netherlands

    Thanks all! Committed the latest patch.

  • πŸ‡¨πŸ‡¦Canada Sseto

    Should I use the dev version to get the update or will there Beta8 release soon? Thanks everyone!

  • πŸ‡©πŸ‡ͺGermany IT-Cru Munich

    +1 for a new beta release :)

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    So we need to reiterate in the release notes that there are manual steps to remediation.

    Comments #11-13 and #19 are all talking about it.

    As said in #13, an upgrade hook is impossible because the configuration has been polluted/changed by the last release so there is no feasible way to identify who had what checked prior.

    Reconfiguration of the module is the only valid step forward.

  • πŸ‡©πŸ‡ͺGermany Grevil

    I don't quite understand, why an update hook is not feasible here?

    Before, an entry of "enabled_settings" could either be a string, a boolean or an integer. Meaning we could simply do an empty check on each "enabled_settings" entry and if it is empty, we unset it (just like fieldSettingsFormValidate() does it through the UI) and if it isn't, we simply replace the value with its key, done.

    I'll prepare a follow-up issue for that.

    PS: If you are talking about the config "pollution" through πŸ› Update viewsreference_update_8103 fails if table name is too long and shortened by Drupal Fixed , that could be fixed in the same issue and everyone is happy! :)

  • πŸ‡©πŸ‡ͺGermany Grevil
  • πŸ‡©πŸ‡ͺGermany Grevil

    Create a follow-up issue here: πŸ› Add missing update hook for adjusting viewsreference field settings RTBC .

  • πŸ‡©πŸ‡ͺGermany Grevil

    Alright, done.

    Everyone in need of an update hook for this, please test and checkout the patch here from πŸ› Add missing update hook for adjusting viewsreference field settings RTBC !

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    Grevil,

    I see where you are coming from. Most of us who have experianced this tried to use the configuration form after the bug. This essentially wiped the configuration.

    Obviously I hadn't thought of those who still have configuration intact... say upgrading form beta6 to -dev

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

Production build 0.71.5 2024