Hi all,
In my content type A I have a Entity Reference field pointing to content type B, with an autocomplete widget to use the References Dialog module.
It's all ok: dialog "popup" appears showing my specific View. This View exposes some taxonomy filters to allow filtering results. Ok: filters, view and Dialog do their job and the autocomplete text field is correctly filled with the node of my choice.
The problem is that the autocomplete functionality of this text field is active and so, if a user starts typing some words, a list of nodes suggestion appear, regardless of filter restriction I've setted up in my views, nullifying all this stuff and the scope of this module.
EXAMPLE:
- Content type A -> Content type B
- Content type B is categorized with a taxonomy vocabulary (e.g COLORS: red, yellow, blue, green, gray, white, black)
- My View appearing in the References Dialog exposes that taxonomy as an exposed filter, with a restricted range of terms of the vocabulary (e.g. only red, yellow and blue)
- Using this filters only nodes of type B tagged with red, yellow and blue can be listed as results (that's what I want)
- I choose a node tagged with RED from my results
- The dialog disappear and the autocomplete text filed is correctly filled with the resulting node (all ok)
- PROBLEM: if I start to type some text in the autocomplete field, ALL nodes of type B can appear as suggestions, also if they are tagged with "proibited" colors (green, gray, white, black), nullifying my views filters.
Is there a way to disabling the autocomplete feature? Or any other workaround?
Thank you very much
Comment | File | Size | Author |
---|---|---|---|
#15 | user-view-selction-mode.patch | 712 bytes | liquidcms |
#8 | references_dialog-add_support_views_filters_entityreferences-1479412-8.patch | 1.26 KB | jygastaud |
#4 | reference-dialog-error.jpg | 181.99 KB | MXT |
Comments
Comment #1
MXTA new feature has just been commited in the EntityReference module: "Add views support for providing a list of entities or bundles (views filtering, relationships, etc)" (see: http://drupal.org/node/1253776).
Can we hope in any sort of integration to reach the feature/issue described here?
Thank you very much.
Comment #2
MXTI'm quite puzzled by the fact that nobody has given the deserved attention to this problem.
I'll change this bug as critical because, in fact, this issue makes this module completely unusable. What's the need to do a view with some filters set, when they can be simply bypassed through the autocomplete after closing the dialog?
Thanks for putting more attention on this problem.
Comment #3
fabsor CreditAttribution: fabsor commentedReferences dialog doesn't change the configuration for the formatter it is attached to, it only adds a link to a view where you can select things. Entity reference has it's own settings for limiting content which should be used for this.
You can easily use the same view with the same filter by creating two displays, one for references dialog and one for entity reference. This should do the trick.
Integrating with this functionality from entityreference will be hard to do cleanly, the easiest solution is to simply use the same view for both entityreference and views.
This is definitely not critical, and not a bug either. A critical bug is a bug that makes your site unusable, for instance a PHP fatal error. This is definetly not the case here.
Comment #4
MXTThank you Fabsor for your answer.
What you suggest is the first thing I tried.
The point is that there is a problem: the "add dialog" feature now allow to create ALL kind of node types, regardless of the filtered entities provided by Views.
Please see the image in attachment that shows the issue.
Thank you very much for considering this issue.
Comment #5
fabsor CreditAttribution: fabsor commentedAhh, now I see the problem. I completely misunderstood it before, sorry.
We need to check if entity reference uses views and get the result from there in that case. This should be possible to do.
Comment #6
MXTI think this bug as to be turned to major because de facto makes this module unusable for not skilled users (e.g. our clients with editor role remain confused with plenty of erroneous options to add content types).
Do you have any plans to resolve it?
Thank you very much
Comment #7
mortician CreditAttribution: mortician commentedSame problem. Any update on this?
Comment #8
jygastaud CreditAttribution: jygastaud commentedHere is a small patch for entityreference views filters support.
The patch supports only Node entity type.
Comment #9
MXTYes patch in #8 works very well for me: thank you very much!!!
Comment #10
MXTCan this be committed please?
Thank you very much
Comment #11
rogical CreditAttribution: rogical commentedCommitted, http://drupalcode.org/project/references_dialog.git/commit/142c561.
Comment #13
liquidcms CreditAttribution: liquidcms commentedsorry to re-open but i think my issue is close enough to simply add to this issue.
to start with.. i am using userref (this patch only supports noderef; so possibly that is the only issue here remaining).
my initial issue was that entityreference autocomplete does not provide realname support (#1299156: Support for realname). i then found i could use a view for the entityref source to add realname support and it worked great; except that as soon as i switch entity selection mode from Simple to Views; then i lose support for ref dialog
if this isn't close enough to be considered part of this original issue; let me know and i will raise a new issue.
Comment #14
liquidcms CreditAttribution: liquidcms commentedoh yes.. and gives this error:
Warning: array_keys() expects parameter 1 to be array, null given in references_dialog_entityreference_add_link() (line 250 of /home/admin/public_html/calpoly/sites/all/modules/Fields/references_dialog/references_dialog.dialog_widgets.inc).
Comment #15
liquidcms CreditAttribution: liquidcms commentedsimple fix to make this work for users as well.
Comment #16
liquidcms CreditAttribution: liquidcms commented