jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/387348 )
Change subject: FlaggablePageView::changeSaveButton: Use OOUI methods to over-write ...................................................................... FlaggablePageView::changeSaveButton: Use OOUI methods to over-write This also drops the dependency on the 'dom' PHP extension, in return for increasing the MediaWiki dependency to 1.29+ (default config) or 1.30+ if you account for people using the old config removed then. Bug: T179326 Change-Id: Ieb2cd46b9dddd709c80263c27d845001fe14cca4 --- M frontend/FlaggablePageView.php 1 file changed, 6 insertions(+), 18 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified Jforrester: Looks good to me, but someone else must approve diff --git a/frontend/FlaggablePageView.php b/frontend/FlaggablePageView.php index 32b6cc3..a602f64 100644 --- a/frontend/FlaggablePageView.php +++ b/frontend/FlaggablePageView.php @@ -1901,25 +1901,13 @@ if ( !$this->editWillRequireReview( $editPage ) ) { return true; // edit will go live or be reviewed on save } - if ( extension_loaded( 'domxml' ) ) { - wfDebug( - "Warning: you have the obsolete domxml extension for PHP. Please remove it!\n" - ); - return true; # PECL extension conflicts with the core DOM extension (see bug 13770) - } elseif ( isset( $buttons['save'] ) && extension_loaded( 'dom' ) ) { - $dom = new DOMDocument(); - $dom->loadXML( $buttons['save'] ); // load button XML from hook - foreach ( $dom->getElementsByTagName( 'input' ) as $input ) { // one <input> + if ( isset( $buttons['save'] ) ) { + // This relies on MediaWiki 1.29+ as these are OOUI ButtonInputWidgets: + if ( is_a( $buttons['save'], 'OOUI\ButtonInputWidget' ) ) { $buttonLabel = $this->msg( 'revreview-submitedit' )->text(); - $input->setAttribute( 'value', $buttonLabel ); - // This attempts to re-implement Linker::titleAttrib(); - // TODO, consider a re-use pattern - $buttonTitle = $this->msg( 'revreview-submitedit-title' )->text() . ' ' . - $this->msg( 'brackets', $this->msg( 'accesskey-save' )->text() )->text(); - $input->setAttribute( 'title', $buttonTitle ); // keep accesskey - - # Change submit button text & title - $buttons['save'] = $dom->saveXML( $dom->documentElement ); + $buttons['save']->setLabel( $buttonLabel ); + $buttonTitle = $this->msg( 'revreview-submitedit-title' )->text(); + $buttons['save']->setTitle( $buttonTitle ); } } return true; -- To view, visit https://gerrit.wikimedia.org/r/387348 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb2cd46b9dddd709c80263c27d845001fe14cca4 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/FlaggedRevs Gerrit-Branch: master Gerrit-Owner: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> Gerrit-Reviewer: Jackmcbarn <jackmcb...@gmail.com> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits