There is a lot of warnings if we are mapping a field and using sub-propertyon it if this field is empty. As we speak about search results, some entities (nodes) can have optional(s) field(s), and some of them on some entities can be empty.
Message (watchdog) :
Notice : Undefined index: und in RestfulDataProviderSearchAPI->mapSearchResultToPublicFields() (line 344 in /xxx/sites/all/modules/contrib/restful_search_api/include/RestfulDataProviderSearchAPI.php).
Example :
public function publicFieldsInfo() {
$fields_info = array(
'illustration' => array(
'property' => 'field_content_picture',
'sub-property' => LANGUAGE_NONE . '::0',
),
// ...
);
return $fields_info;
}
This example throw warning if in one (or more) result, the field_content_picture is empty.
In mapSearchResultToPublicFields(), existence of field / key in set of results should be done to avoid that.
Regards
There is a lot of warnings if we are mapping a field and using
sub-propertyon it if this field is empty. As we speak about search results, some entities (nodes) can have optional(s) field(s), and some of them on some entities can be empty.Message (watchdog) :
Notice : Undefined index: und in RestfulDataProviderSearchAPI->mapSearchResultToPublicFields() (line 344 in /xxx/sites/all/modules/contrib/restful_search_api/include/RestfulDataProviderSearchAPI.php).Example :
This example throw warning if in one (or more) result, the
field_content_pictureis empty.In
mapSearchResultToPublicFields(), existence of field / key in set of results should be done to avoid that.Regards