Posted by naxoc on October 5, 2012 at 11:43am
3 followers
Jump to:
| Project: | Views |
| Version: | 7.x-3.x-dev |
| Component: | Documentation |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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);
* }
* }
* @endcodeBut 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.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| default_arguments_constructor.patch | 800 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 1,603 pass(es). | View details |
Comments
#1
This certainly fixes something :) Thanks for the patch!
#2
Perfect! Committed and pushed.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.