Closed (fixed)
Project:
Views Reference Field
Version:
8.x-2.0-beta7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2023 at 08:11 UTC
Updated:
17 May 2024 at 12:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
perry.franken commentedA created a path for this issue.
Comment #3
perry.franken commentedComment #4
perry.franken commentedchanged it to string:
Comment #5
hudriFor people looking for a fix to the "display title option" or "only pagination and argument shown" problem, this patch here makes that option work again.
I think the approach here is correct. The configuration values of
enabled_settingsare always strings, even if the actual per-field setting values stored in the DB are of other types.Comment #6
hudriComment #7
hudriComment #8
redeight commentedAs hudri said, the patch fixes an issue we're having with using these options on our sites.
Comment #9
ricovandevin commentedI 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).
Comment #10
sseto commentedConfirm #4 fixes my issue too!
Comment #11
paulrad commentedHi, guys!
Shouldn't there be some update function to make those changes applicable to the current users?
Comment #12
hudriDue this bug it is not possible to activate those options, so I don't think an update hook could reliably fix this.
Comment #13
daletrexelAdd 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.
Comment #14
generalredneckAss 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.
Comment #15
daletrexelPatch #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.
Comment #16
generalredneckFor 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: stringThat 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 pieces in the configuration schema that are now unused.
Comment #17
daletrexelThanks, @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!
Comment #18
daisyleroy commentedpatch #14 fixes my issue thanks !
Comment #19
liberatrFor 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)
...where the old incorrect values were:
Comment #21
seanbThanks all! Committed the latest patch.
Comment #22
sseto commentedShould I use the dev version to get the update or will there Beta8 release soon? Thanks everyone!
Comment #23
it-cru+1 for a new beta release :)
Comment #24
generalredneckSo 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.
Comment #25
grevil commentedI 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 #2925609: Update viewsreference_update_8103 fails if table name is too long and shortened by Drupal, that could be fixed in the same issue and everyone is happy! :)
Comment #26
grevil commentedComment #27
grevil commentedCreate a follow-up issue here: #3445081: Add missing update hook for adjusting viewsreference field settings.
Comment #28
grevil commentedAlright, done.
Everyone in need of an update hook for this, please test and checkout the patch here from #3445081: Add missing update hook for adjusting viewsreference field settings!
Comment #29
generalredneckGrevil,
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