In certain conditions (see below), if the WHERE clause is set to ?Only on New? in the databasejoin element, the query on the databasejoin table does not include the WHERE clause.
Looking into this, I now know why ? I just have no idea how to fix it.
This is occurring when I click the Add icon in a joined form. The new record being added is to the joined table ? not the ?master? table used in the form. This is why it doesn't work.
Here's what I found...
In the protected function mustApplyWhere() in datbasejoin.php - The line...
$isnew = $app->input->get('rowid', 0) === 0;
will always return $isnew as false because $app->input->get('rowid') will return the rowid of the controlling (parent) form - so it is never zero.
Does anyone have any idea what value needs to be checked in that mustApplyWhere() function in order to get this to work properly when the ?add? is on a joined table in a form? It looks like $app->input->get('rowid', 0) just isn?t cutting it, in this case.
Looking into this, I now know why ? I just have no idea how to fix it.
This is occurring when I click the Add icon in a joined form. The new record being added is to the joined table ? not the ?master? table used in the form. This is why it doesn't work.
Here's what I found...
In the protected function mustApplyWhere() in datbasejoin.php - The line...
$isnew = $app->input->get('rowid', 0) === 0;
will always return $isnew as false because $app->input->get('rowid') will return the rowid of the controlling (parent) form - so it is never zero.
Does anyone have any idea what value needs to be checked in that mustApplyWhere() function in order to get this to work properly when the ?add? is on a joined table in a form? It looks like $app->input->get('rowid', 0) just isn?t cutting it, in this case.