The title reference is used in the handler but the base field uses the default base_field type (usually nid I believe). This causes some erratic behavior on node-references that use views (specifically views with relationships). The behavior I witnessed was where the reference nid was the argument passed but the title was set to the last relationship that was iterated over for the query - the query returned multiple rows, but the result set visible was always one, the argument.

The fix that worked for me (see attached patch) was to check and see if there is a base_field_alias set and then use that to iterate over the result set.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

christianchristensen’s picture

christianchristensen’s picture

Some more issues - I had this patch from a while ago - I believe this check is necessary to ensure the case of an empty view not allowing the selection of a false reference.

bdlangton’s picture

Here is an update to the patch to prevent the following notices from showing:

Undefined index: nid in content_plugin_style_php_array_ac->render()
Trying to get property of non-object in content_plugin_style_php_array_ac->render()