Notice: Undefined index: group by in quiz_views_handler_filter_quiz_nid->construct() (line 46 of ...\quiz\includes\views\handlers\quiz_views_handler_filter_quiz_nid.inc).
The group_by property is not initalized.
I try to change these codes to solve this problem:
function construct() {
parent::construct();
/*
* $this->vid_field = !empty($this->definition['vid field']) ? $this->definition['vid field'] : 'vid';
$this->group_by = $this->definition['group by'];
if (!empty($this->definition['secondary group by'])) {
$this->secondary_group_by = $this->definition['secondary group by'];
}
*/
}
--> AND Add function :
function init(&$view, &$options) {
parent::init($view, $options);
$this->vid_field = !empty($this->definition['vid field']) ? $this->definition['vid field'] : 'vid';
$this->group_by = $this->definition['group by'];
if (!empty($this->definition['secondary group by'])) {
$this->secondary_group_by = $this->definition['secondary group by'];
}
}
----------
System :
Drupal 7.16
My SQL: 5.1
PHP 5.2.8
Apache 2.2
Windows 7 Pro 64 bits.
Comments
Comment #1
A Romka commentedIf you add:
to quiz\includes\views\handlers\quiz_views_handler_filter_quiz_nid.inc - it'll fix that error.
Comment #2
tonyhrx commentedWould love to know what line to add that there code to!
Thanks!
Comment #3
kenyan commented@A Romka, Tried to add your code at line 47 but no joy. Error persists.
Where should the code go?
Comment #4
kenyan commentedNever mind. Moved the code to line 46 and that 'sorts' the issue out.
This works for 7x-4.0-alpha12
UPDATE:
Spoke too soon, the error reappears now at line 49. So help still requested.
Comment #5
A Romka commentedyou need to change:
to:
Comment #6
mohammed j. razemPatch attached.
Comment #7
mohammed j. razemSorry, this is the correct patch. The previous one had another patch with it.
Comment #8
tgolding commentedThanks A Romka! Seems to be working like a charm.
Comment #9
devenpro commentedThanks A Romka works fine +1 to #5.
Comment #10
kenyan commentedPatch #7 working good.
Comment #11
sivaji_ganesh_jojodae commentedPatch committed to git. Thanks.
Comment #12.0
(not verified) commentedChange format code