Permalink
Browse files

fix(pages): removes deprecated notices regarding input/write_access

Deprecation notices will only occur if a dev has extended forms/pages/edit
or input/write_access

Fixes #8327
  • Loading branch information...
mrclay committed Nov 27, 2015
1 parent 125948f commit fdcab74b1e9069736f88f7e9aa36aeb15067b8fe
Showing with 15 additions and 2 deletions.
  1. +8 −1 mod/pages/views/default/forms/pages/edit.php
  2. +7 −1 mod/pages/views/default/input/write_access.php
@@ -59,7 +59,14 @@
}
}
- echo elgg_view($input_view, $view_vars);
+ $output = elgg_view($input_view, $view_vars);
+
+ if ($input_view === 'input/write_access' && strpos($output, "<!-- -->") !== 0) {
+ // a dev has extended input/write_access
+ elgg_deprecated_notice("The input/write_access view is deprecated. The pages plugin now uses the ['access:collections:write', 'user'] hook to alter options.", "1.11");
+ }
+
+ echo $output;
?>
</div>
<?php
@@ -1,5 +1,11 @@
<?php
+// this is just to be detected by the pages edit form for deprecation purposes.
+echo "<!-- -->";
+
echo elgg_view('input/access', $vars);
-elgg_deprecated_notice("The input/write_access view is deprecated. The pages plugin now uses the ['access:collections:write', 'user'] hook to alter options.", "1.11");
+if (!elgg_extract('purpose', $vars)) {
+ // a dev has extended the page edit form
+ elgg_deprecated_notice("The input/write_access view is deprecated. The pages plugin now uses the ['access:collections:write', 'user'] hook to alter options.", "1.11");
+}

0 comments on commit fdcab74

Please sign in to comment.