r65253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65252‎ | r65253 | r65254 >
Date:21:55, 18 April 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added 'sfUserCanEditPage' hook; fix for default values of '0'
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc
@@ -176,9 +176,12 @@
177177 $this->mPageTitle = Title::newFromText($page_name);
178178 global $wgOut;
179179 // show previous set of deletions for this page, if it's been deleted before
180 - if (! $form_submitted && ! $this->mPageTitle->exists())
 180+ if (! $form_submitted && ! $this->mPageTitle->exists()) {
181181 $this->showDeletionLog($wgOut);
182 - if (($wgUser->isAllowed('edit') && $this->mPageTitle->userCan('edit')) || $is_query) {
 182+ }
 183+ $user_can_edit_page = ($wgUser->isAllowed('edit') && $this->mPageTitle->userCan('edit'));
 184+ wfRunHooks('sfUserCanEditPage', array(&$user_can_edit_page));
 185+ if ($user_can_edit_page || $is_query) {
183186 $form_is_disabled = false;
184187 $form_text = "";
185188 // show "Your IP address will be recorded" warning if user is
@@ -631,7 +634,7 @@
632635 is_array($template_instance_query_values) &&
633636 array_key_exists($escaped_field_name, $template_instance_query_values)) {
634637 $field_query_val = $template_instance_query_values[$escaped_field_name];
635 - if ($form_submitted || ($field_query_val && ! is_array($field_query_val))) {
 638+ if ($form_submitted || ($field_query_val != '' && ! is_array($field_query_val))) {
636639 $cur_value = $field_query_val;
637640 }
638641 } else

Status & tagging log