mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Allow maintenance script to work even when DiscussionToolsEnablePermalinksBackend is off"
This commit is contained in:
commit
0df02e1c71
|
@ -45,7 +45,9 @@ class DataUpdatesHooks implements RevisionDataUpdatesHook {
|
|||
$updates[] = new MWCallableUpdate( function () use ( $rev, $method ) {
|
||||
try {
|
||||
$threadItemSet = HookUtils::parseRevisionParsoidHtml( $rev, $method );
|
||||
$this->threadItemStore->insertThreadItems( $rev, $threadItemSet );
|
||||
if ( !$this->threadItemStore->isDisabled() ) {
|
||||
$this->threadItemStore->insertThreadItems( $rev, $threadItemSet );
|
||||
}
|
||||
} catch ( Throwable $e ) {
|
||||
// Catch errors, so that they don't cause other updates to fail (T315383), but log them.
|
||||
MWExceptionHandler::logException( $e );
|
||||
|
|
|
@ -61,7 +61,7 @@ class ThreadItemStore {
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isDisabled(): bool {
|
||||
public function isDisabled(): bool {
|
||||
return !$this->config->get( 'DiscussionToolsEnablePermalinksBackend' );
|
||||
}
|
||||
|
||||
|
@ -349,7 +349,7 @@ class ThreadItemStore {
|
|||
* @return bool
|
||||
*/
|
||||
public function insertThreadItems( RevisionRecord $rev, ThreadItemSet $threadItemSet ): bool {
|
||||
if ( $this->isDisabled() || $this->readOnlyMode->isReadOnly() ) {
|
||||
if ( $this->readOnlyMode->isReadOnly() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ class PersistRevisionThreadItems extends Maintenance {
|
|||
if ( HookUtils::isAvailableForTitle( $title ) ) {
|
||||
$threadItemSet = HookUtils::parseRevisionParsoidHtml( $rev, false );
|
||||
|
||||
// Store permalink data
|
||||
// Store permalink data (even when store is disabled - T334258)
|
||||
$changed = $this->itemStore->insertThreadItems( $rev, $threadItemSet );
|
||||
}
|
||||
} catch ( Throwable $e ) {
|
||||
|
|
Loading…
Reference in a new issue