Calling DatabaseConnection::exec_SELECTgetRows() with an invalid $uidIndexField returns only a single row
If one accidentally calls DatabaseConnection::exec_SELECTgetRows() with an invalid $uidIndexField, the method only returns a single record.
The reason is that the existence of the specified field is not verified. If the field is not set, the code
$output[$tempRow[$uidIndexField]] = $tempRow;
$output = $tempRow;
which simply overrides the first entry of the array. This happens for every record, hence finally only the last record of the query result is returned.
The method should check the $uidIndexField really exists and should throw an exception otherwise, in order to inform the developer of the mistake.
[!!!][BUGFIX] Check for existing index column in exec_SELECTgetRows()
In case the specified $uidIndexField does not exist in the result,
throw an exception.
Do not call debug() again since it has already been called in
Reviewed-by: Andreas Fernandez <email@example.com>
Tested-by: Andreas Fernandez <firstname.lastname@example.org>
Reviewed-by: Frank Nägler <email@example.com>
Tested-by: Frank Nägler <firstname.lastname@example.org>