I need to implement hook_views_query_alter()
to change the value of delta of the field that form a relationship.
As I posted in change delta value, the code is the following one.
function supermama_misc_views_query_alter($view, $query) {
$view->$query->table_queue['field']['join']->extra[2]['value'] = 1;
}
It gives me the following error:
Fatal error: Cannot access empty property
The same error appears if I use the following code.
function supermama_misc_views_post_build($view) {
if ($view->name == 'gallery_images') {
$view->$query->table_queue['field']['join']->extra[2]['value'] = 1;
}
}
What's wrong with the code? How do I bypass the error?
dpr()
orvar_dump
problematic variable. Knowing what's in$view
and in$query
will tell us what's empty - and knowing what is empty is a key to tell how to make it full or to substitute it.