Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello
In the file views/includes/handlers.inc:1163 the sample code is incorrect.
The method views_join_complex::construct() signature in the sample require 4 arguments and 2 optional arguments,
but the views_handler_relationship::query(): never pass these arguments, views/handlers/views_handler_relationship.inc:111.
The right sample code is:
class views_join_complex extends views_join {
// PHP 4 doesn't call constructors of the base class automatically from a
// constructor of a derived class. It is your responsibility to propagate
// the call to constructors upstream where appropriate.
function construct($table = NULL, $left_table = NULL, $left_field = NULL, $field = NULL, $extra = array(), $type = 'LEFT') {
parent::construct($table, $left_table, $left_field, $field, $extra, $type);
}
function join($table, &$query) {
$output = parent::join($table, $query);
$output .= "AND foo.bar = baz.boing";
return $output;
}
}
Comment | File | Size | Author |
---|---|---|---|
#2 | 881060.patch | 1.08 KB | benoit.borrel |
Comments
Comment #1
dawehnercan you create a patch? This would be cool
Comment #2
benoit.borrel CreditAttribution: benoit.borrel commentedHere is the patch. Credit to Sweetchack.
Comment #3
dagmarComment #4
dawehnerLooks fine, but this patch has to be rerolled for d7. (just a note)
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to D6 both 2.x and 3.x branches.
Comment #6
dawehnerFinally managed to convert it.