Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm creating a view that lists Users with an Entity Reference display, so I can add it to a field. When I add the display to the view I get the message 'Display "Entity Reference" needs a selected search fields to work properly. See the settings for the Entity Reference list format.'
When I go to the list format, there are not Search Fields listed. How do I add them? What am I missing? Or is this a bug?
Comment | File | Size | Author |
---|---|---|---|
#6 | entityreference_display_search.jpeg | 28.56 KB | rwilson0429 |
#4 | entityreference-checkboxes_default_value-1810434-4.patch | 717 bytes | JvE |
Screenshot from 2012-10-11 21:48:05.png | 171.31 KB | Matt B |
Comments
Comment #1
Nimajn CreditAttribution: Nimajn commentedI have the same problem.
Comment #2
Matt BComment #3
drasgardian CreditAttribution: drasgardian commentedremains an issue in the latest dev
Comment #4
JvE CreditAttribution: JvE commentedThe module sets the #default_value of a checkboxes element to $this->options['search_fields']
this can be NULL, while the only allowed value is an array.
A patch to change
'#default_value' => $this->options['search_fields'],
to
'#default_value' => isset($this->options['search_fields']) ? $this->options['search_fields'] : array(),
is attached.
Comment #5
JvE CreditAttribution: JvE commentedComment #6
rwilson0429 CreditAttribution: rwilson0429 commentedI was able to set an Entity Reference search field without the use of the patch.
You can select your entity reference search field by doing the following:
If this doesn't work, apply the patch in #4, flush caches, then follow the steps above.
Comment #7
cinnamon CreditAttribution: cinnamon commentedFor me the solution was to update views and ctools. This patch did nothing
Comment #8
seafront CreditAttribution: seafront commentedI found checking the search fields box in the entity ref list settings as rwilson0429 suggested worked - but the error message remained until I'd saved the view. At which point it vanished.
Usability for this ought to be addressed.
Comment #9
JvE CreditAttribution: JvE commentedThe patch addresses a code bug where a variable that can be NULL is used in a place where only an array is allowed.
If you have error reporting on (recommended during development) you will get a "Warning: Invalid argument supplied for foreach() in form_type_checkboxes_value()" when you click on Settings in the Format section.
This will prevent you from reaching the screen rwilson0429 shows and creating the display.
Comment #10
Yaron Tal CreditAttribution: Yaron Tal commentedThe patch in #4 works for me.
Without the patch I get
To reproduce:
1. Create a new view with no page or block.
2. Add an Entityreference display.
3. Click on "Settings" for the format.
Step 3 gives me an error. The patch fixes this.
Comment #11
intrafusionI can also confirm that the patch in #4 works for me and the steps to reproduce in #10 are correct.
Please can we get this applied to the module and new release created? #2050653: Roll a 1.1 release?
Comment #12
ctapial CreditAttribution: ctapial commentedI confirm that #6 did the trick for me. So simple...
Comment #13
rwohlebYep, patch from #4 worked for me. Since this has been reviewed/tested, let's get this committed :)
Comment #14
morsokPatch 4# worked for me too. Thx !
Comment #15
nmancini CreditAttribution: nmancini commentedPatch worked for me - thanks much!
Comment #16
sonicthoughts CreditAttribution: sonicthoughts commented#10 worked for me. drush cc, change settings. Not at all intuitive thought.
Comment #18
electrocret CreditAttribution: electrocret commented#4 worked for me. Thanks!
Comment #19
shailu29 CreditAttribution: shailu29 commented#10 worked for me
Comment #20
eawheeler CreditAttribution: eawheeler commentedApplying the patch in post # 4 to 7.x-1.1 resolved this for me.
Comment #21
sonicthoughts CreditAttribution: sonicthoughts commentedPlease commit.
Comment #22
jami CreditAttribution: jami at ThinkShout commentedPatch 4 fixed this for me as well. Thank you!
Comment #23
gparsloe CreditAttribution: gparsloe commented#6 just worked for me.
Comment #24
prsnjtbarman CreditAttribution: prsnjtbarman as a volunteer and commented#6 solves the problem
Comment #25
bmateus CreditAttribution: bmateus commentedHad this problem again... Patch #4 solves it, could not access the instructions in #6 as it breaks with an AJAX error.
Comment #26
thmohd CreditAttribution: thmohd commentedPatch 4 is for dev. do you guys have patch for the released version.
Comment #27
andrbmgi CreditAttribution: andrbmgi commented#4 worked for me in 7.x-1.1 (not dev) had AJAX error before.
Comment #28
bohemier CreditAttribution: bohemier commentedJust had this problem too. Using a drupal 7.42 with views 7.x-3.13 & entityreference 7.x-1.1. Patch in #4 resolved the issue.
Comment #29
owntheweb CreditAttribution: owntheweb commentedI just had this issue with Drupal 8.1.1. To reproduce:
Workaround:
After seeing the error, in a new tab, clear the cache at Configuration -> Performance. Refresh the views tab and choose Settings next to Format: Entity Reference list.
UPDATE:
I posted this under the wrong issue (wrong version of Drupal). Apologies, coffee still soaking in...
Comment #30
calefilm CreditAttribution: calefilm commentedConfirm #6. Thank you.
Comment #31
arunkumarkPatch #4 Working Fine.
Comment #33
spotzero CreditAttribution: spotzero at Coldfront Labs Inc. commentedCommitted.