hyku icon indicating copy to clipboard operation
hyku copied to clipboard

Empty flash messages appear on work or collection forms

Open laritakr opened this issue 2 years ago • 0 comments

Descriptive summary

This error was encountered in both Louisville (Hyrax v2.9.6) and UTK (Hyrax v 3.4.1). This ticket replaces a similar UTK-specific ticket.

When trying to save a work or collection with metadata which does not pass rails server-side validations, we see an empty flash message on the screen. This may be a Hyrax bug or may be Hyku-specific. See screenshots below.

If the submission error is fixed and resubmitted, there may also be another error situation with permission templates which was overridden in Louisville and reported as a bug on Hyrax.

Rationale

Even though Hyku does not have built-in server-side metadata validations, if repositories built over Hyku add validations, these validations should be handled correctly. It should not be handled in each individual repository. UTK validates that there is only one title, and Louisville validates that slugs are unique. Both repositories have encountered this error.

Expected behavior

A metadata error in a work or collection should show an error telling what is incorrect, and allow correction of the error and resubmission of the form. There should be no empty flash error boxes on the screen.

Actual behavior

  • blank error messages may appear because the Hyrax partial _flash_msg.html.erb is not receiving the appropriate information to display the messages.
  • Redisplaying the form, correcting the error, and resubmitting resulted in a permission template error.

Steps to reproduce the behavior

  1. Create a work with metadata that fails rails validations (i.e. a second title for UTK or a duplicate slug in Louisville). Note that Hyku itself does not use rails validations on the objects, so a valid may need to be added to be able to duplicate the issue here.
  2. Fix the error and resubmit the form without a full form refresh.

Related work

Hyrax ticket regarding permission template error

Screenshots

Screen Shot 2022-10-11 at 3 12 29 PM

Screen Shot 2022-10-11 at 3 12 50 PM

laritakr avatar Oct 11 '22 19:10 laritakr