omeka / Omeka

A flexible web publishing platform for the display of library, museum and scholarly collections, archives and exhibitions.
http://omeka.org
GNU General Public License v3.0
472 stars 193 forks source link

Error reporting on installation form. #1009

Closed ponchio closed 10 months ago

ponchio commented 10 months ago

Got the cryptic error in the installation form:

There were errors found in your form. Please edit and resubmit.

And could not figure what the error was. So I updated the install/views/scripts/index/index.phtml to report the errors:

<p><?php echo __('There were errors found in your form. Please edit and resubmit.'); ?></p>
     <?php $errors = $this->form->getMessages();
    foreach($errors as$field=>$error) { ?>
    <p><?php echo $field.': '.current($error)?></p>
    <?php } ?>

$errors is an array like this: ['password' => ['passwordTooShort' => 'Password needs to be at least 6 characters in length']]

This would help new users. Didn't want to make a PR, someone can just copy and adapt this 4 lines of code.

zerocrates commented 10 months ago

This is actually a regression from the new theme introduced in version 3.0. The install form is supposed to display those error messages next to the form fields that they apply to.

I made a fix that restores that behavior.