- Issue created by @selwynpolit
- 🇮🇹Italy pheudo
Hi @selwynpolit,
I have difficulties replicating the issue you opened.
Could you please verify if the issue is still present with the 1.0.6 version? - 🇺🇸United States selwynpolit
Thanks for taking a look. I did retest with version 1.0.6 and I get the same results. I do have the views reference extras module enabled. I'll try it again without that.
- 🇺🇸United States selwynpolit
That doesn't seem to make any difference. I updated to the latest and greatest of everything, deleted the view reference field and created a new one. Then I tried to edit some content. Just enabling the checkbox "Show Filters on Page" and saving the node caused the error.
Is it a known bug that the first time you select a view and select a display, that the options don't show anything?
- 🇦🇺Australia amarshkhl09
I have come across a similar issue after updating to Drupal 10.4.x. However upon troubleshooting this, it doesn't seem to be from the Drupal core or the Views Reference Field Filter module but rather from the Views Reference module - https://www.drupal.org/project/viewsreference → . Downgrading it to 2.0@beta8 fixed the issue for me.
- Status changed to Postponed: needs info
3 months ago 8:56pm 12 March 2025 - 🇺🇸United States jsweetack
Have this same issue after updating to 10.3.9, with Layout Paragraphs, only for a certain paragraph type, and it results in an AJAX error in the console, preventing any saving of the paragraph.
Downgrading to 2.0-beta8 works, thanks to @amarshkhl09 for figuring that out.
Is there a proper fix for this in the works?
- 🇺🇸United States bburg Washington D.C.
I am also experiencing this, with the 1.0.6 version of this module, and 2.0-beta10 of viewsreference → . In my case, I have views reference fields in a paragraph type, which are loaded from a general paragraph field with unlimited cardinality.
For one, I think it we can make the code safer in ViewsRefFilterUtility::loadView() by checking that it's not null/empty later after we try to load the view when we detect that it's empty. Since we declare that variable static right before this line, I think it would always be true since it will be "set", but in this case, seems to have no value.
Adding a "&& !empty($view)" right before
$view = $this->viewsExecutableFactory->get($view);
to resolve the error for me. Though I'm still not sure why it's happening. After running some tests in xdebug, I do see that subsequent attempts to add an additional view embed field via paragraph type appears to try to load the view with the Human readable label instead of the view's machine name. e.g. $view_name = "My View" instead of "my_view"
This is a bit complicated, but the problem seems to be somewhere in ViewsReferenceTrait::itemCurrentValues() in the viewsreference module. This seems to be where we sometimes get the view label in lieu of the machine name, around here:
$input_values = NestedArray::getValue($form_input_values, $value_parents, $input_value_exists);
- First commit to issue fork.
- 🇪🇸Spain Carlitus
Created a MR to check if the view name it's not _none. In my case this resolves this issue.