I came across a module today that has copy-pasted some of the documentation on handlers to get started. I do that all the time myself and I love it when modules provides a "starter" like that.

 * @code
 * 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, $left_table, $left_field, $field, $extra = array(), $type = 'LEFT') {
 *     parent::construct($table, $left_table, $left_field, $field, $extra, $type);
 *   }
 *
 *   function build_join($select_query, $table, $view_query) {
 *     $this->extra = 'foo.bar = baz.boing';
 *     parent::build_join($select_query, $table, $view_query);
 *   }
 * }
 * @endcode

But it seems that the snippet is causing PHP notices by code called by views itself. In line 118 og handlers.inc the constructor is called with no arguments.

Patch puts default arguments (NULL) in all arguments to the constructor.

CommentFileSizeAuthor
default_arguments_constructor.patch800 bytesnaxoc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This certainly fixes something :) Thanks for the patch!

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Perfect! Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.