Join / link table / error

Join / link table / error

nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
edited November 2012 in Editor
Hi,

When NOT setting a value when updating a record, I get the following error:

[code]
Notice: Undefined index: tblExerciseEquipment in /Users/nathan/Sites/xxx.com/functions/datatables/Editor/Join.php on line 474
[/code]

I don't get the error when selecting (checkbox) one or more items.

Please point me in the right direction.

[code]

Join::inst( 'tblExerciseEquipment', 'array' )
->join(
array( 'EID', 'f_EID' ),
array( 'EEquipmentID', 'f_EEID' ),
'tblExercisesXEquipment'
)
//->set(false)
->field(
Field::inst( 'EEquipmentID' )->validator( 'Validate::required' ),
Field::inst( 'EquipmentName0' )
)
[/code]

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    I'm afraid you've hit a bug in the Join class there.

    If you change line 466 from:

    [code]
    if ( ! $this->_set ) ) {
    [/code]

    to

    [code]
    if ( ! $this->_set || ! isset($data[$this->_name]) ) {
    [/code]

    That will resolve the problem.

    Basically the issue is what when submitting an empty array has HTTP variables, the parameter simply doesn't get sent to the serve - so we need to check for its existence, which, as you see, was missing from `Join` .

    Thanks for flagging this up. The fix will be in the next Editor release.

    Allan
  • nskwortsownskwortsow Posts: 120Questions: 0Answers: 0
    Thanks!
This discussion has been closed.