Hello,
When I select in PM Gantt View to enable possibility for adding or editing Tasks, soon a lot of new cross or plus sign are added, but they are are all in error when using.
• Notice: Undefined index: #language in views_gantt_prepopulate_field() (line 436 of /home/devel/drupal-7.50/sites/all/modules/views_gantt/views_gantt.module).
• Notice: Undefined index: nid in views_gantt_prepopulate_field() (line 437 of /home/devel/drupal-7.50/sites/all/modules/views_gantt/views_gantt.module).
Drupal core 7.50
Drupal PM 7.x-2.2
Pm Gantt 7.x-2.0-beta1
Views 7.x-3.14
Views_gantt 7.x-2.0-rc1
Ctools 7.x-1.10
Date 7.x-2.10-rc1
...
Comment | File | Size | Author |
---|---|---|---|
#7 | 2788717-undefined-index-fix-7.patch | 797 bytes | kekkis |
01 Drupal PM Gantt.jpg | 104.95 KB | vcouver | |
02 Drupal PM Gantt Enable possibility.png | 85.92 KB | vcouver | |
03 Drupal PM Gantt View saved.png | 50.78 KB | vcouver | |
04 Drupal PM Gantt ERROR EditTASK Undefined idex language.png | 53.17 KB | vcouver |
Comments
Comment #2
vcouver CreditAttribution: vcouver as a volunteer and commentedComment #3
vcouver CreditAttribution: vcouver as a volunteer and commentedComment #4
vcouver CreditAttribution: vcouver as a volunteer and commentedComment #5
vcouver CreditAttribution: vcouver as a volunteer and commentedsame errors.
• Notice: Undefined index: #language in views_gantt_prepopulate_field() (line 436 of .../drupal-7.53/sites/all/modules/views_gantt/views_gantt.module).
• Notice: Undefined index: nid in views_gantt_prepopulate_field() (line 437 of .../drupal-7.53/sites/all/modules/views_gantt/views_gantt.module).
with
drupal 7.53
pm 7.x-2.2
pmgantt 7.x-2.0-beta1
views 7.x-3.14
views_gantt 7.x-2.0-rc1
dhtmlxGantt 4
Comment #6
vcouver CreditAttribution: vcouver as a volunteer and commentedHello,
To avoid the "Undefined index" error message, coming from the two lines 436 and 437.
436 $language = $form[$field_name]['#language'];
437 $type = $form_state['field'][$field_name][$language]['field']['type'];
You can by example, use a ternary operator :
436 $language = (isset($form[$field_name]['#language'])) ? $form[$field_name]['#language'] : LANGUAGE_NONE;
437 $type = isset($form_state['field'][$field_name][$language]['field']['type']) ?
438 $form_state['field'][$field_name][$language]['field']['type'] : '';
What do you think about these modifications ? :
Comment #7
kekkisAdding a patch which IMO better adheres to coding style.
Additionally it removes the unused
$type
assignment.Comment #8
kekkisComment #10
alexshipilov CreditAttribution: alexshipilov at AnyforSoft for AnyforSoft commentedThanks kekkis and vcouver
Comment #11
alexshipilov CreditAttribution: alexshipilov at AnyforSoft for AnyforSoft commented