Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T7582: Only run updateManageWiki() when status changes from something… #4

Merged
merged 1 commit into from Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions includes/RequestSSLManager.php
Expand Up @@ -479,14 +479,11 @@ public function setTarget( string $target ) {
__METHOD__
);
}

public function updateManageWiki ( string $remotewiki ) {
$status = $this->getStatus;
if ( $status == 'complete' ) {
$remoteWiki = new RemoteWiki( $this->getTarget() );
$remoteWiki->setServerName( $this->getCustomDomain() );
$remoteWiki->commit();
}
$remoteWiki = new RemoteWiki( $this->getTarget() );
$remoteWiki->setServerName( $this->getCustomDomain() );
$remoteWiki->commit();
}

/**
Expand Down
8 changes: 6 additions & 2 deletions includes/RequestSSLViewer.php
Expand Up @@ -420,6 +420,8 @@ protected function submitForm(
return;
}

$oldStatus = $this->requestSslRequestManager->getStatus();

if ( isset( $formData['submit-edit'] ) ) {
$this->requestSslRequestManager->startAtomic( __METHOD__ );

Expand Down Expand Up @@ -554,8 +556,10 @@ protected function submitForm(
$comment = $this->context->msg( 'requestssl-status-updated', strtolower( $statusMessage ) )
->inContentLanguage()
->escaped();

$this->requestSslRequestManager->updateManageWiki( $user );

if ($oldStatus !== 'complete' && $formData['handle-status'] === 'complete') {
$this->requestSslRequestManager->updateManageWiki( $user );
}

if ( $formData['handle-comment'] ) {
$commentUser = User::newSystemUser( 'RequestSSL Status Update' );
Expand Down