I did some initial searching with Entity References and Views Contextual Filtering. There appear to be some other issues, but none that were exactly like this. I'm a bit new to Drupal, so I'm not sure if I'm doing something wrong, or if there is a bug here. Sorry for the long post, but I wanted to be as thorough as possible in my description as this crosses Drupal, Entity Reference, and Views.
What I want to do is create a view with a contextual reference on field3 (below). I want to use this filter to only show the nodes that match the filter. I see the field3 and data (Content Type A title field) appear in the table in auto preview when I leave the Preview with contextual filters: empty. However, as soon as I try to type a text string that would match field3 (which is the title of Content Type A), no results are returned.
I'm also getting errors (shown below) when I try to setup the Entity Selection mode to Views.
Am I doing something wrong, or is this a bug?
Any help would be greatly appreciated.
Thanks,
Jonathan
--
Drupal 7.14, Entity Reference 7.x-1.0-rc3
Content Type A
title, node module element
field1
field2
...etc
Content Type B
title, node module element
field1
field2
field3, Entity Reference, select list
field 3 settings:
Number of values: 1
Target type Node
Entity Selection mode: Simple (more on this later)
Target bundles: Content Type A
Sort: don't sort
Render Views - same behavior checked or unchecked
Test behavior - unchecked.
View
format: table
Fields
Content: title
Content: Content Type B field3
Filter
Content: published(yes)
Content: type (=Content Type B)
Contextual Filters
Content: Content Type B field3
All Displays
Display all results for the specified field
nothing else checked
The first bug is if I try to check Views as the Entity Selection Mode, I get this pop-up error:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /system/ajax
StatusText: OK
ResponseText:
Fatal error: Class EntityReference_SelectionHandler_Views contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EntityReference_SelectionHandler::validateAutocompleteInput) in D:\development\drupal\sites\mysite\sites\all\modules\entityreference\plugins\selection\EntityReference_SelectionHandler_Views.class.php on line 150
If I hit OK and then Save Settings, I get this error filling the screen.
Fatal error: Class EntityReference_SelectionHandler_Views contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EntityReference_SelectionHandler::validateAutocompleteInput) in D:\development\drupal\sites\mysite\sites\all\modules\entityreference\plugins\selection\EntityReference_SelectionHandler_Views.class.php on line 150
If I try to go back to Simple, then I get this pop-up error:
An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /system/ajax
StatusText: OK
ResponseText:
Fatal error: Class EntityReference_SelectionHandler_Views contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (EntityReference_SelectionHandler::validateAutocompleteInput) in D:\development\drupal\sites\mysite\sites\all\modules\entityreference\plugins\selection\EntityReference_SelectionHandler_Views.class.php on line 150
So I have to exit all the way back out to Structure and cancel my proposed changes in order to get back to Simple mode.
Comments
Comment #1
mvlabat CreditAttribution: mvlabat commentedHave the same issue.
Comment #2
mvlabat CreditAttribution: mvlabat commentedFound. :) About AJAX Errors:
http://drupal.org/node/1608358
Comment #3
mvlabat CreditAttribution: mvlabat commentedstatus... Ooops.
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedit is indeed duplicate..patch here : http://drupal.org/node/1608358#comment-6061086
fix this..or download latest dev version