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.
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.
Comment | File | Size | Author |
---|---|---|---|
#7 | undefined_index_group_by-1827880-7.patch | 873 bytes | Mohammed J. Razem |
#6 | undefined_index_group_by-1827880-6.patch | 1.25 KB | Mohammed J. Razem |
Comments
Comment #1
A Romka CreditAttribution: 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 CreditAttribution: tonyhrx commentedWould love to know what line to add that there code to!
Thanks!
Comment #3
kenyan CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: tgolding commentedThanks A Romka! Seems to be working like a charm.
Comment #9
devenpro CreditAttribution: devenpro commentedThanks A Romka works fine +1 to #5.
Comment #10
kenyan CreditAttribution: kenyan commentedPatch #7 working good.
Comment #11
Sivaji_Ganesh_Jojodae CreditAttribution: Sivaji_Ganesh_Jojodae commentedPatch committed to git. Thanks.
Comment #12.0
(not verified) CreditAttribution: commentedChange format code