Robmoen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73043


Change subject: Add notices for pages protected from creation
......................................................................

Add notices for pages protected from creation

Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
---
M ApiVisualEditor.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/43/73043/1

diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index ea37c9a..fb83e1f 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -265,7 +265,7 @@
                                if ( $parsed && $parsed['restoring'] ) {
                                        $wgVisualEditorEditNotices[] = 
'editingold';
                                }
-                               // Protected page
+                               // Page protected from editing
                                if ( $page->getNamespace() != NS_MEDIAWIKI && 
$page->isProtected( 'edit' ) ) {
                                        # Is the title semi-protected?
                                        if ( $page->isSemiProtected() ) {
@@ -275,6 +275,10 @@
                                                $wgVisualEditorEditNotices[] = 
'protectedpagewarning';
                                        }
                                }
+                               // Page protected from creation
+                               if ( !$page->exists() && 
$page->getRestrictions( 'create' ) ) {
+                                       $wgVisualEditorEditNotices[] = 
'titleprotectedwarning';
+                               }
                                if ( count( $wgVisualEditorEditNotices ) ) {
                                        foreach ( $wgVisualEditorEditNotices as 
$key ) {
                                                $notices[] = wfMessage( $key 
)->parseAsBlock();

-- 
To view, visit https://gerrit.wikimedia.org/r/73043
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I829c104e1c62e0ad2b48d526447b1ede8408bc6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to