- Issue created by @c. s. comfort
- 🇺🇸United States alison
I'm experiencing this issue, too! -- updated viewsreference 2.0.0-beta6 => 2.0.0-beta7, and the only "extra settings" I can enable are Argument and Pagination. I checked on an environment that still has beta6, and on that environment, I can enable/disable all the "extra settings" checkboxes.
- My field is a simple viewsreference field on a node, no Paragraphs involved.
- I don't lose the other "extra settings" in the node edit form until I save the field settings -- until I save the field settings (and lose the "extra settings"), the "Include View Title" checkbox still still shows in the node form. (That said, I haven't tried enabling that checkbox to see if it "works" or if it's just "there" -- and I'm afraid at this point I just need to roll back the update and carry on with work, I can't do that test right now -- but I figured I'd at least share what I saw!)
- I don't see anything in watchdog/drupal logs.
FWIW, I'm still on Drupal 9.5.11 (PHP 8.1).
- 🇩🇪Germany IT-Cru Munich
Same here. After downgrade to 2.0.0-beta6 all is working fine for me again D10.1.
- 🇮🇳India Shani Maurya Mumbai
Same for me as well, I need to enable the "Include View Title" but It doesn't get enabled after checking the checkbox.
- 🇫🇮Finland hartsak
Just adding some findings here after a quick debugging. Maybe these will help in solving the issue?
In my case, it looks like the extra setting for "title" has been saved as a boolean value where the code assumes it is a string.For example from the config yml file of my "viewsreference" field:
enabled_settings: argument: argument title: true
In this example the argument works as expected, but the title doesn't.
Because of that, in the node edit form, the "Include view title" field doesn't appear. The setting for the title doesn't get through in line 154 of file
viewsreference/src/Plugin/Field/FieldWidget/ViewsReferenceTrait.phpforeach ($enabled_settings as $enabled_setting) { if (!empty($plugin_definitions[$enabled_setting])) {
In addition to that, the setting for title doesn't work when it is passed forward with the $enabled_settings in the file
viewsreference/src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php$view->element['#viewsreference'] = [ 'data' => unserialize($item->getValue()['data'], ['allowed_classes' => FALSE]), 'enabled_settings' => $enabled_settings, 'parent_entity_type' => $parent_entity_type, 'parent_entity_id' => $parent_entity_id, 'parent_field_name' => $parent_field_name, ];
Not sure yet how this could be fixed, as simply manually fixing the config file and doing a config import doesn't seem to help. I have added a quick hotfix that helps in my case, but this only helps with the symptoms not with the cause. So if others have the same issue too, you can try the hotfix but a proper fix would be better :)
- First commit to issue fork.
- last update
12 months ago 1 pass - Status changed to Needs review
12 months ago 2:07pm 27 November 2023 - last update
12 months ago 1 pass - 🇦🇹Austria arthur_lorenz Vienna
The config schema for the field settings was off and expected integer values instead of strings. The config is saved using the option value instead of some integer/boolean, e.g.:
enabled_settings: offset: 'offset' limit: 'limit'
- Status changed to RTBC
12 months ago 9:05am 28 November 2023 - 🇪🇸Spain Carlitus
For me still doesn't work. When enabled MR38 it works as before, when i submit the field edit form, only argument and pager can be enabled in Enable extra settings.
In the config export i see this:
enabled_settings: argument: argument limit: 0 pager: pager offset: 0
If i change to
enabled_settings: argument: argument limit: 1 pager: pager offset: 1
and import the new config nothing happens, i don't see the limit and offset options in the entity where the field is included.
- 🇦🇹Austria arthur_lorenz Vienna
For me still doesn't work. When enabled MR38 it works as before, when i submit the field edit form, only argument and pager can be enabled in Enable extra settings.
In the config export i see this:
enabled_settings:
argument: argument
limit: 0
pager: pager
offset: 0Hmm, looks like the schema did not get updated. Did you clear the cache?
If i change to
enabled_settings:
argument: argument
limit: 1
pager: pager
offset: 1and import the new config nothing happens, i don't see the limit and offset options in the entity where the field is included.
Of course, the value should match the key, as for argument and pager. So you'll need to change it to
enabled_settings: argument: argument limit: limit pager: pager offset: offset
- 🇪🇸Spain Carlitus
I seem to have broken the first two laws of the drupal programmer:
First law: Clear the cache
Second law: If that doesn't work clear the cache again.And now it works, thank you very much
- 🇺🇸United States rraney
When I updated this module and upgraded to Drupal 10, all of my view blocks are now showing titles, whereas they previously did not. I think it might relate to this, since I cannot save the setting "Include View Title". Specifically, this is the case with blocks and view blocks. I'm not sure if it's related. I will try this hotfix, but if anyone has a suggestion, please share.
- 🇦🇹Austria arthur_lorenz Vienna
P.S. I applied this patch.
You should've applied the patch from the referenced merge request :)
- 🇺🇸United States rraney
This is what I applied:
"3400712: Enable extra settings only allows for saving of Pagination and Argument options" : " https://www.drupal.org/files/issues/2023-11-23/viewsreference-hotfix-ena... → "Appears to be the same thing.
- 🇦🇹Austria arthur_lorenz Vienna
No, that's not the merge request. This is: https://git.drupalcode.org/project/viewsreference/-/merge_requests/38
- 🇺🇸United States rraney
OK I've never merged from github, but I added .patch to the end and found this.
https://git.drupalcode.org/project/viewsreference/-/merge_requests/38.patchI applied the patch. It worked
- Status changed to Closed: duplicate
11 months ago 10:37am 11 January 2024 - 🇦🇹Austria hudri Austria
This is a duplicate of #3402036 🐛 Configuration schema for "Enable extra settings" (title,pagination,...) incorrect Fixed
While both issues fix the problem, I don't the the solution proposed here is correct. IMHO the correct approach is the one from 3402036: Fix the type definition in the parent sequence, not change the value type of every single item ifself.