Notice: Undefined variable: result_indexes in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 222 of H:\wamp\www\drupal\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 222 of H:\wamp\www\drupal\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 227 of H:\wamp\www\drupal\sites\all\modules\editableviews\editableviews_plugin_style_row_edit_table.inc).
Notice: Undefined variable: edit_field_handlers_grouped in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 227 of H:\wamp\www\drupal\sites\all\modules\editableviews\editableviews_plugin_style_row_edit_table.inc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Title: ERRORS » Undefined variable errors in insert_form_elements()
Status: Active » Postponed (maintainer needs more info)

Can you give me more details?

What sort of view is it? How is it built?

Can you debug to see why that is not set?

kaizerking’s picture

FileSize
3.16 KB

It is simple view please find the attached exported view

joachim’s picture

You don't seem to have added any editable fields to this view.

kaizerking’s picture

Yes,I have removed them to test,
if i haven't assigned any editable fields then it should not give any error right?

joachim’s picture

> if i haven't assigned any editable fields then it should not give any error right?

Without any editable fields, it simply won't work!

I should probably add some validation so it complains until you add some, but that could prove a bit annoying.

kaizerking’s picture

Let me explain more on what I am trying to do
I have following entities:

Ledger
Ledger number ranges
Number range settings

'Ledger'
1 Sl. No:'serial' field Auto increment

'Ledger number ranges' has two fields
1"From" integer field 2 'To' integer field

'Ledger number range settings' has two fields

1 entity reference referencing 'Ledger number ranges'
2. A Boolean field Check box

Process:these three entities will be different transactions.
Ill use rules to 'set' the Ledger number based on the 'Ledger number ranges' field values
i,e the number will not be greater than the to values and not less than from value.
How ever the range should be active to use and create ledger which is decided by the boolean field.
That's the view which I have attached/

I think there is clash between field widget of the entity form and the field widget of entity editable views
I am also getting this error
Notice: Undefined index: display_label in options_field_widget_form() (line 137 of H:\wamp\www\drupal\modules\field\modules\options\options.module).

joachim’s picture

Sorry, I don't really follow any of the above.

Please could you explain the specific problem you are having in a specific view? If you can simplify the view as far as possible first that would be a help.

kaizerking’s picture

FileSize
14.82 KB
4.84 KB

here is the simple view attached also the error page

joachim’s picture

> $view->base_table = 'eck_financial_year';

I'm not going to be able to import that, am I?

Can you reproduce this with a single boolean field on nodes?

kaizerking’s picture

FileSize
5.1 KB

Here is the exported feature,
I do not want to use node, as actual error is on entities so the debugging will be appropriate for the given use case.

joachim’s picture

> I do not want to use node, as actual error is on entities so the debugging will be appropriate for the given use case.

The entity type should not matter, unless ECK is doing something weird.

kaizerking’s picture

You are right ,if i use content types i am not getting any errors
probably it is eck thing

kaizerking’s picture

FileSize
3.88 KB

You are right ,if i use content types i am not getting any errors
probably it is eck thing
attached node version

marcvangend’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Active

I'm getting the same error Notice: Undefined index: display_label in options_field_widget_form() (line 137 of /var/www/modules/field/modules/options/options.module). when displaying a user entity. One of the columns displays a boolean checkbox field.

The notice is triggered when options_field_widget_form() is trying to render that boolean field. 4 levels up in the call stack is line 144 of editableviews_handler_field_field_edit.inc, where edit_form() calls ctools_field_invoke_field().

Hope this helps.

marcvangend’s picture

Status: Active » Needs review
FileSize
934 bytes

Here is a patch that merges default values for missing widget settings into the field instance. At least it solves the notice mentioned in #14, maybe it solves others too.

Thanks for reviewing.

NWOM’s picture

Thank you for #15. It fixed my problem with the following notices always being shown after a save:

Notice: Undefined index: batch in editableviews_entity_form() (line 99 of /var/aegir/platforms/panopoly-7.x-1.35/sites/{SITE}/modules/editableviews/editableviews.module).
Notice: Undefined index: batch_size in editableviews_entity_form() (line 101 of /var/aegir/platforms/panopoly-7.x-1.35/sites/{SITE}/modules/editableviews/editableviews.module).
Notice: Undefined index: batch in editableviews_entity_form() (line 99 of /var/aegir/platforms/panopoly-7.x-1.35/sites/{SITE}/modules/editableviews/editableviews.module).
Notice: Undefined index: batch_size in editableviews_entity_form() (line 101 of /var/aegir/platforms/panopoly-7.x-1.35/sites/{SITE}/modules/editableviews/editableviews.module).

Edit: Nevermind, I spoke too soon. My issue still remains. Not sure if this patch effects my problem, so please disregard this comment.

nickonom’s picture

To replicate the error just check on the option Show the empty text in the table under Edit view > Format > Settings and it will output:

Notice: Undefined variable: result_indexes in editableviews_plugin_style_row_edit_table->insert_form_elements() (line 224 of /home/username/public_html/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 225 of /home/username/public_html/sites/all/modules/editableviews/editableviews_plugin_style_row_edit_table.inc).

The patch in #15 tries to deal with the problem too late, because ideally the execution should quit the function insert_form_elements($result) in the very beginning if there is no any $result.

The proposed patch should do. It is against 7.x-1.x as https://www.drupal.org/project/editableviews/git-instructions for some reason doesn't have dev version.

Status: Needs review » Needs work

The last submitted patch, 17: undefined_variables-1963690-17.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.