After upgrading to 7.2 beta 3 I now get these errors in my node edit form where I have my tablefields. For ever table cell I have I get a new error line, but I'll just paste 1 in... I have replaced my site path & name with "[...MYSITENAME...]"

I have gone back to alpha 5 and the error dissappears

Error message
Notice: Undefined index: cell_0_5 in tablefield_field_widget_form() (line 328 of /mounted-storage/home82c/sub004/sc28983-MVYV/[...MYSITENAME...]sites/all/modules/tablefield/tablefield.module).

CommentFileSizeAuthor
#1 1119320-1.patch831 byteskevin hankens

Comments

kevin hankens’s picture

Status: Active » Needs review
StatusFileSize
new831 bytes

Thanks for the notice. If there is no default value, it kind of throws up :) The attached patch should fix that.

kevin hankens’s picture

Status: Needs review » Closed (fixed)

Committed to 7.x-2.0-beta4.

Thx!

carylson’s picture

Version: 7.x-2.0-beta3 » 7.x-2.0-beta4
Status: Closed (fixed) » Active

Ran into an issue with this fix, as the $instance['default_value'][$delta]['tablefield'] array doesn't necessarily contain a value for every cell in the table, as this fix assumes it does.

IMO a better fix would be the following on line 328:
$instance_default = isset($instance['default_value'][$delta]['tablefield']["cell_{$i}_{$ii}"]) ? $instance['default_value'][$delta]['tablefield']["cell_{$i}_{$ii}"] : array();

Instead of:
$instance_default = isset($instance['default_value'][$delta]) ? $instance['default_value'][$delta]['tablefield']["cell_{$i}_{$ii}"] : array();

Regards

simon georges’s picture

amfis’s picture

Fix mentioned in #3 works as expected.

arbel’s picture

#3 works here too +1

kevin hankens’s picture

Status: Active » Closed (fixed)

Sorry for the delay. Committed to master.