Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
When ticking the checkbox "Show the empty text in the table" in Editable Views Table Settings the following error appear if there are no results in the table.
Notice: Undefined variable: result_indexes in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 222 of /sites/all/modules/editableviews/editableviews_plugin_style_row_edit_table.inc).
Notice: Undefined variable: result_indexes_reverse in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 223 of /sites/all/modules/editableviews/editableviews_plugin_style_row_edit_table.inc).
Notice: Undefined variable: result_indexes in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 222 of /sites/all/modules/editableviews/editableviews_plugin_style_row_edit_table.inc).
Notice: Undefined variable: result_indexes_reverse in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 223 of /sites/all/modules/editableviews/editableviews_plugin_style_row_edit_table.inc).
Comment | File | Size | Author |
---|---|---|---|
#5 | editableviews-undefined_result_indexes-2287425-10319031-7.x-1.x-dev.patch | 1.12 KB | sukh.singh |
#2 | undefined_result_indexes.patch | 1.18 KB | doppel |
Comments
Comment #1
joachim CreditAttribution: joachim commentedIt looks like what happens is that when you enable that option, Views renders the table display plugin. This results in a special case where the plugin is used with an empty result set. The code in this module isn't designed to cope with that.
Should be fairly easy to fix with a few early bail-outs in functions, along the lines of:
If you're able to investigate and make a patch that would be great!
Comment #2
doppel CreditAttribution: doppel commentedHello, I made a patch for this.
Comment #3
joachim CreditAttribution: joachim commentedI don't quite follow what you're doing.
If either of the variables that are going to be put into the array are empty, then you're putting an empty string in? What were the values that tested as empty?
Also, surely we can bail earlier than this?
Comment #4
sukh.singh CreditAttribution: sukh.singh commented@joachim is correct, there is any issue when no result is returned by the query. I am suppling a patch for this as follows
Comment #5
sukh.singh CreditAttribution: sukh.singh commented