STEPS:

  1. create view called "View 1"
  2. create page display for View 1 called "Page" (machine name should be "page_1")
  3. create second page display for View 1 called "Page 2" (machine name should be "page_2")
  4. create another view called "View 2"
  5. add View field to View 2
    1. (See https://www.drupal.org/node/2794483 for explanation of steps below)
    2. don't configure
    3. click Apply
    4. click newly added view field to configure
    5. select "View 1" from View dropdown
    6. select "Page" from Display dropdown
    7. click Apply
  6. repeat step 5 (and sub steps), but this time select "Page 2" from the Display dropdown

PROBLEM:
The view field with View 1:Page field should work fine, but you cannot create a view field for View 1:Page 2. Doing so will cause the following form error: "An illegal choice has been detected. Please contact the site administrator.". My testing suggests this you can only use display's with "page_1" as the machine name for a View field. Furthermore, based on default Core behavior, this means you cannot use a non-page display (a block display, for example) unless you change the display's machine name to "page_1" (I created a block display and changed its machine name from "block_1" to "page_1" and it did not throw the error).

WORKAROUND:
Create a separate view with only 1 display and ensure that the display's machine name is "page_1". This works perfectly well, but it would be bad practice to give non-page displays a machine name of "page_1". Furthermore, it prevents the site admin from efficiently grouping similar displays together under 1 view. For example, I'd like to have a view called "Views Field Views" with all of my sub view pages grouped together under one umbrella. But, given the current bug, I must instead create:

  1. Views Field View People Pictures:Page
  2. Views Field View People Hobbies:Page
  3. Views Field View Employee Employers:Page

instead of:

  1. Views Field Views
    1. People Pictures
    2. People Hobbies
    3. Employee Employers
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xeM8VfDh created an issue. See original summary.

xeM8VfDh’s picture

Issue summary: View changes
xeM8VfDh’s picture

Issue summary: View changes
xeM8VfDh’s picture

Title: Can only use first page display of view for View Field View sub-view » Can only use view displays with "page_1" machine name for View field sub-view
Issue summary: View changes
xeM8VfDh’s picture

Issue summary: View changes
xeM8VfDh’s picture

Issue summary: View changes
gilmord’s picture

One more workaround is:

- add "view field" and select any allowed display (page_1, for me "master" was also allowed)
- export configs
- edit config file and change "page_1" to any display you need
- import configs

xeM8VfDh’s picture

Thanks for the handy workaround @gilmord. I am guessing the project is (unfortunately) completely dead, otherwise this would be addressed. Its a pretty crucial bug given the module's intended functionality. No commits have been made in a long time. Hopefully someone is still listening...

xeM8VfDh’s picture

Priority: Normal » Major
rockaholiciam’s picture

bump

xeM8VfDh’s picture

...crickets...

aaronglamb’s picture

...welcome to the d8 contrib world...

xeM8VfDh’s picture

indeed. At least there is a module that works. Hopefully one of the devs will chime in eventually.

gg24’s picture

Hi,

I am not able to reproduce this issue. Can you please check this once again.

Checked on Drupal 8.4.x and views_field_view 8.x-1.x version.

Thanks!

xeM8VfDh’s picture

Sorry @gg24, this issue (as well as the referenced issue) are still occurring. I tested using https://simplytest.me/

The only module I installed in that environment was views_field_view 8.x-1.0-beta2 on Drupal core 8.4.1. Followed the steps above, got the exact same results.

gg24’s picture

Hi @xeM8VfDh,

Sorry I am able to reproduce this now. Actually I checked it on dev version before.
Trying to get a patch for this.

Thanks!

xeM8VfDh’s picture

Awesome, thanks for the assistance @gg24! We really appreciate it :)

purushotam.rai’s picture

I was also able to reproduce the issue, I tried to debug this and came up with following investigations:

We were missing a simple thing, the current views option in form build function was not using user input and hence this issue was coming, I've added a patch for this.

Thanks and Regards

purushotam.rai’s picture

Status: Active » Needs review
labboy0276’s picture

Status: Needs review » Reviewed & tested by the community

Added the patch and it does allow me now to select any type of display.

Honza Pobořil’s picture

Version: 8.x-1.0-beta2 » 8.x-1.x-dev

#18 works for me with dev.

markdc’s picture

Have been using #18 in prod for months. Time for a new release yet?

xeM8VfDh’s picture

I agree @fatmarker, can the dev's please release this?

jibran’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Thanks, for the patch and testing the fix. We just need to write some tests to make sure it won't happen again.

scottsawyer’s picture

I've been using this for a while now, seems to do the job. Can we commit it and create a follow up issue for adding the tests?