Forcing description of changes entry

Arturo R.
2005-11-25
2013-04-17
  • Arturo R.
    Arturo R.
    2005-11-25

    I'm looking for a way to force editors to enter a description of their changes. I tried adding a return(ewiki_t("something")) on the plugins/edit/log.php file if $log is empty, but all it does is use the previous value of $log as the description of changes.

    What would be the best way to go about this?

     
    • Arturo R.
      Arturo R.
      2005-11-25

      This is bad. You should spend a little more time trying to solve things yourself before asking for help. :)

      I made the following changes to plugins/edit/log.php:

      $ewiki_plugins["edit_save"][] = "ewiki_edit_save_changelog";
      function ewiki_edit_save_changelog(&$save, &$old_data) {
         global $ewiki_errmsg;
         $log = trim($_REQUEST[EWIKI_UP_CHANGELOG]);
         if (empty($log)) {
           $ewiki_errmsg = "You <strong>must</strong> enter a description of your changes before saving. Please try again.";
           $save = false;
           return false;
         }

         $save["meta"]["log"] = $log;
      }

      It's not the right way to do it because the error message is now hardcoded instead of using variables, but it will do. ewiki is a wonderful piece of software. Thanks!