Skip to content

Commit

Permalink
[FEATURE] Integrate Update into ControlCenter
Browse files Browse the repository at this point in the history
Rework step 4 and 5 with handling errors during install of extension by extension manager.

Resolves: T3Voila#295
Release: 8.0.0
  • Loading branch information
Alexander Opitz committed Aug 8, 2021
1 parent f7d1f7e commit 8801514
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,12 @@ protected function step5Action()
$objectManager = GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
/** @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility */
$installUtility = $objectManager->get(\TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class);
$installUtility->install($selection);

try {
$installUtility->install($selection);
} catch (\UnexpectedValueException $e) {
$errors[] = 'Error while installing Extension. Please do this by your own. Original message from extension manager is: "' . $e->getMessage() . '"';
}

// Read mapping information from json
$covertingInstructions = json_decode($_POST['covertingInstructionsJson'], true);
Expand Down Expand Up @@ -1437,6 +1442,11 @@ protected function step5Action()
->execute();
}

$this->view->assignMultiple([
'errors' => $errors,
'hasError' => (count($errors) ? true : false),
]);

// Write into sys_registry including which storage_pid we already did
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ <h2>Step 4 - Extension created/updated</h2>

<div class="row">
<div class="col-sm-4">
<button class="btn btn-default btn-block btn-lg" type="submit" name="step" value="3">
<f:link.action action="step3" class="btn btn-default btn-block btn-lg">
<core:icon identifier="actions-view-go-back" /> Back to step 3
</button>
</f:link.action>
</div>
<div class="col-sm-4">
<button class="btn {f:if(condition='!{hasError}', then='btn-success', else='btn-primary')} btn-block btn-lg" type="submit" name="step" value="4">
<button class="btn {f:if(condition='!{hasError}', then='btn-success', else='btn-primary')} btn-block btn-lg" type="submit">
<core:icon identifier="actions-system-refresh" /> Rerun step 4
</button>
</div>
<div class="col-sm-4">
<button class="btn btn-primary btn-block btn-lg {f:if(condition='{hasError}', then='disabled')}" type="{f:if(condition='{hasError}', then='button', else='submit')}" id="continueButton" name="step" value="5">
<f:form.button class="btn btn-primary btn-block btn-lg {f:if(condition='{hasError}', then='disabled')}" type="{f:if(condition='{hasError}', then='button', else='submit')}" id="continueButton" additionalAttributes="{formaction: '{f:uri.action(controller: \'Backend\\ControlCenter\\TemplaVoilaPlus8Update\', action: \'step5\')}'}">
<core:icon identifier="actions-view-go-forward" /> Continue with step 5
</button>
</f:form.button>
</div>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,18 @@ <h2>Step 5 - Update database</h2>
</f:for>
</ul>
</f:be.infobox>

<p><input type="checkbox" name="overwrite" value="true"> Remove data or overwrite on rerun.</p>
</f:if>

<f:if condition="!{hasError}">
<p class="lead">All done, hopefully TV+ converted your complete dream of a website to the new configuration and you are amazed how this worked out so good.</p>
<p class="lead">If you like, TV+ can now eliminate all old data, so you get a clean setup, you made a backup, did you? Otherwise return to the Update Script selection</p>
<p class="lead">If you like, TV+ can now eliminate all old data, so you get a clean setup, you made a backup, did you? Otherwise return to the Update Script selection.</p>
</f:if>

<div class="row">
<div class="col-sm-4">
<form action="#" method="POST">
<input type="hidden" name="update" value="" />
<button class="btn btn-primary btn-block btn-lg" type="submit" name="step" value="start">
<core:icon identifier="actions-view-go-back" /> Back to TV+ Update Script collection
</button>
</form>
<f:link.action controller="Backend\ControlCenter\Update" action="info" class="btn btn-primary btn-block btn-lg">
<core:icon identifier="actions-view-go-back" /> Back to TV+ Update Script collection
</f:link.action>
</div>
<div class="col-sm-4">
</div>
Expand Down

0 comments on commit 8801514

Please sign in to comment.