Problem/Motivation

This issue seems so glaring, that I think I must be doing something wrong. I set up a views reference field, with an exposed filter. But when I try to add the view on an entity, it doesn't seem to save the override value I put there.

Steps to reproduce

  1. Install/enable viewsreference and this module.
  2. Create a content type with a term reference field.
  3. Create two nodes tagged by different terms (let's call it "term 1" and "term 2").
  4. Create a view that shows content of this type, with an exposed filter for the term reference field you used. Add a Block display for the view.
  5. Create a content type with a Views reference field. Enable the field setting to use the "Exposed Filters - editor view" option.
  6. Create a node of that content type with the views reference field.
  7. Select the view created above, and the block display.
  8. Save.
  9. At this point, viewing the node should show the view embed with both nodes referencing term 1 and 2.
  10. Edit the node again, this time it will load the exposed filters from the view. Add a filter value, say term 2, and save.
  11. Viewing the saved node still shows both term 1 and 2 nodes.
  12. Now try to edit the views reference node again, the view field's settings don't seem to have saved the exposed filter value you entered.

Am I missing something? This seems like the basic usage of this module. I've tried this on an existing project, and on a from sandbox scratch site I use for testing things outside of a complex project context.

Edit: Just adding supplemental info. This is what the field DB record looks like in both the field and field revision tables:

 a:7:{s:6:"header";N;s:6:"offset";N;s:5:"title";N;s:5:"pager";N;s:5:"limit";N;s:8:"argument";N;s:15:"exposed_filters";N;} 

Also, I can add a default value it's filtering by in the view, but that only persists, and I can't override that value either.

Comments

bburg created an issue. See original summary.

bburg’s picture

Issue summary: View changes
lalop’s picture

I have the same issue with drupal 10.5

lalop’s picture

In fact the issue come from better expose filter in my case.

pheudo’s picture

Status: Active » Postponed (maintainer needs more info)

Hi @bburg,

I tried to replicate your steps, but I didn't encounter your problem, also with the latest version of viewsreference and Drupal.
In fact, the specific scenario you mentioned was also tested in a PHPUnit test.

Could you please give me more details?

nilsson’s picture

Hello,

Having the same issue, I tried to strip down the views and @lalop has it right : problem has to do with Better Exposed Filters. In my case, the Checkbox / Radio option on any field results in unsaved options.

I don't know if it's a BEF issue or a viewsreference_filter issue (or both ?) : the error is silent.