I posted this a few weeks back and had no response - then now realize I posted it in the wrong (2.x) forum.
I?m getting an error whenever I update a form that contains 3 joined groups.
The system error message that is generated is something like...
Store row failed: Update blah blah blah WHERE
(i.e. The sql command ends at WHERE)
Looking into this I see that problem is in components/com_fabrik/models/list.php - function updateObject()
The 1st if statement continues the foreach loop if the field is an Internal or NA field. That is why the error occurs. Because if the current $v is an array field type (like internalid or databasejoin), BUT is also the keyName needed for updating the record, then the $where value is never initialized correctly.
You need to add another check in that 1st if statement to check if it is the keyName, and if so, store the value of $v[0] to $v and allow the next if statement to do its thing (initialize $where), else "continue" ONLY if it?s not the keyName.
I (again) updated from GitHub just before posting this.
I may be missing something, but I changed that 1st "if" condition as shown below and it seems to work ok.
I?m getting an error whenever I update a form that contains 3 joined groups.
The system error message that is generated is something like...
Store row failed: Update blah blah blah WHERE
(i.e. The sql command ends at WHERE)
Looking into this I see that problem is in components/com_fabrik/models/list.php - function updateObject()
The 1st if statement continues the foreach loop if the field is an Internal or NA field. That is why the error occurs. Because if the current $v is an array field type (like internalid or databasejoin), BUT is also the keyName needed for updating the record, then the $where value is never initialized correctly.
You need to add another check in that 1st if statement to check if it is the keyName, and if so, store the value of $v[0] to $v and allow the next if statement to do its thing (initialize $where), else "continue" ONLY if it?s not the keyName.
I (again) updated from GitHub just before posting this.
I may be missing something, but I changed that 1st "if" condition as shown below and it seems to work ok.
PHP:
if (is_array($v) or is_object($v) or $k[0] == '_')
{
// Internal or NA field
if ($k == $keyName)
{
$v = $v[0];
}
else
{
continue;
}
if ($k == $keyName)
{
// PK not to be updated
$where = $keyName . '=' . $db->quote($v);
continue;
}
ETC....
}