STEPS:
- create view called "View 1"
- create page display for View 1 called "Page" (machine name should be "page_1")
- create second page display for View 1 called "Page 2" (machine name should be "page_2")
- create another view called "View 2"
-
add View field to View 2
- (See https://www.drupal.org/node/2794483 for explanation of steps below)
- don't configure
- click Apply
- click newly added view field to configure
- select "View 1" from View dropdown
- select "Page" from Display dropdown
- click Apply
- 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:
- Views Field View People Pictures:Page
- Views Field View People Hobbies:Page
- Views Field View Employee Employers:Page
instead of:
-
Views Field Views
- People Pictures
- People Hobbies
- Employee Employers
Comment | File | Size | Author |
---|---|---|---|
#18 | can-only-use-views-2794491.patch | 621 bytes | purushotam.rai |
|
Comments
Comment #2
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #3
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #4
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #5
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #6
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #7
gilmordOne 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
Comment #8
xeM8VfDh CreditAttribution: xeM8VfDh commentedThanks 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...
Comment #9
xeM8VfDh CreditAttribution: xeM8VfDh commentedComment #10
rockaholiciam CreditAttribution: rockaholiciam commentedbump
Comment #11
xeM8VfDh CreditAttribution: xeM8VfDh commented...crickets...
Comment #12
aaronglamb CreditAttribution: aaronglamb commented...welcome to the d8 contrib world...
Comment #13
xeM8VfDh CreditAttribution: xeM8VfDh commentedindeed. At least there is a module that works. Hopefully one of the devs will chime in eventually.
Comment #14
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedHi,
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!
Comment #15
xeM8VfDh CreditAttribution: xeM8VfDh commentedSorry @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.
Comment #16
gg24 CreditAttribution: gg24 as a volunteer and at QED42 commentedHi @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!
Comment #17
xeM8VfDh CreditAttribution: xeM8VfDh commentedAwesome, thanks for the assistance @gg24! We really appreciate it :)
Comment #18
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedI 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
Comment #19
purushotam.rai CreditAttribution: purushotam.rai at QED42 commentedComment #20
labboy0276 CreditAttribution: labboy0276 at Tandem commentedAdded the patch and it does allow me now to select any type of display.
Comment #21
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commented#18 works for me with dev.
Comment #22
markdcHave been using #18 in prod for months. Time for a new release yet?
Comment #23
xeM8VfDh CreditAttribution: xeM8VfDh commentedI agree @fatmarker, can the dev's please release this?
Comment #24
jibranThanks, for the patch and testing the fix. We just need to write some tests to make sure it won't happen again.
Comment #25
scottsawyerI'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?