Remove the current_result global variable
Replaces it with a local variable. Signed-off-by: Maurício Meneghini Fauth <mauricio@mfauth.net>
This commit is contained in:
parent
728f682c9e
commit
657d1d0784
@ -2306,13 +2306,12 @@
|
||||
<code><![CDATA[$rowId]]></code>
|
||||
</MixedArgumentTypeCoercion>
|
||||
<MixedAssignment>
|
||||
<code><![CDATA[$GLOBALS['current_result']]]></code>
|
||||
<code><![CDATA[$isUpload]]></code>
|
||||
<code><![CDATA[$repopulate]]></code>
|
||||
<code><![CDATA[$whereClause]]></code>
|
||||
</MixedAssignment>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$GLOBALS['current_result']]]></code>
|
||||
<code><![CDATA[$currentResult]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
<PossiblyNullArgument>
|
||||
<code><![CDATA[$isUpload]]></code>
|
||||
|
||||
@ -54,8 +54,6 @@ class ChangeController implements InvocableController
|
||||
|
||||
public function __invoke(ServerRequest $request): Response
|
||||
{
|
||||
$GLOBALS['current_result'] ??= null;
|
||||
|
||||
$this->pageSettings->init('Edit');
|
||||
$this->response->addHTML($this->pageSettings->getErrorHTML());
|
||||
$this->response->addHTML($this->pageSettings->getHTML());
|
||||
@ -224,9 +222,7 @@ class ChangeController implements InvocableController
|
||||
|
||||
InsertEdit::$pluginScripts = [];
|
||||
foreach ($rows as $rowId => $currentRow) {
|
||||
$GLOBALS['current_result'] = is_array($result) && isset($result[$rowId])
|
||||
? $result[$rowId]
|
||||
: $result;
|
||||
$currentResult = is_array($result) && isset($result[$rowId]) ? $result[$rowId] : $result;
|
||||
$repopulate = [];
|
||||
$checked = true;
|
||||
if (isset(self::$unsavedValues[$rowId])) {
|
||||
@ -242,7 +238,7 @@ class ChangeController implements InvocableController
|
||||
UrlParams::$params,
|
||||
$tableColumns,
|
||||
$commentsMap,
|
||||
$GLOBALS['current_result'],
|
||||
$currentResult,
|
||||
$insertMode,
|
||||
$currentRow ?: [],
|
||||
$isUpload,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user