Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.inc |
— | — | @@ -176,9 +176,12 @@ |
177 | 177 | $this->mPageTitle = Title::newFromText($page_name); |
178 | 178 | global $wgOut; |
179 | 179 | // 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()) { |
181 | 181 | $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) { |
183 | 186 | $form_is_disabled = false; |
184 | 187 | $form_text = ""; |
185 | 188 | // show "Your IP address will be recorded" warning if user is |
— | — | @@ -631,7 +634,7 @@ |
632 | 635 | is_array($template_instance_query_values) && |
633 | 636 | array_key_exists($escaped_field_name, $template_instance_query_values)) { |
634 | 637 | $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))) { |
636 | 639 | $cur_value = $field_query_val; |
637 | 640 | } |
638 | 641 | } else |