Join / link table / error
Join / link table / error
nskwortsow
Posts: 120Questions: 0Answers: 0
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]
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]
This discussion has been closed.
Replies
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