Commit 92faee17 authored by Carsten  Rose's avatar Carsten Rose

Rename variable

parent 4ca41995
Pipeline #3170 passed with stages
in 1 minute and 57 seconds
......@@ -2228,14 +2228,14 @@ abstract class AbstractBuildForm {
* @param array $formElement
* @param array $primaryRecord
* @param string $rcText
* @param string $nameColumnId
* @param string $rcNameColumnId
*
* @return bool
* @throws \UserFormException
*/
private function prepareSubrecord(array $formElement, array $primaryRecord, &$rcText, &$nameColumnId) {
private function prepareSubrecord(array $formElement, array $primaryRecord, &$rcText, &$rcNameColumnId) {
if (!isset($primaryRecord['id'])) {
if (!isset($primaryRecord[$rcNameColumnId])) {
$rcText = 'Please save this record first.';
return false;
......@@ -2253,15 +2253,16 @@ abstract class AbstractBuildForm {
}
// Check if $nameColumnId column exist.
if (!isset($formElement[FE_SQL1][0][$nameColumnId])) {
if (!isset($formElement[FE_SQL1][0][$rcNameColumnId])) {
// no: try fallback.
$nameColumnId = '_id';
if (!isset($formElement[FE_SQL1][0][$nameColumnId])) {
$rcNameColumnId = '_' . $rcNameColumnId;
if (!isset($formElement[FE_SQL1][0][$rcNameColumnId])) {
throw new \UserFormException(
json_encode([ERROR_MESSAGE_TO_USER => "Missing column [_]$nameColumnId in subrecord query", ERROR_MESSAGE_TO_DEVELOPER => $formElement[FE_SQL1]]),
json_encode([ERROR_MESSAGE_TO_USER => "Missing column $rcNameColumnId in subrecord query", ERROR_MESSAGE_TO_DEVELOPER => '']),
ERROR_SUBRECORD_MISSING_COLUMN_ID);
}
}
return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment