Metalab / mos

Metalab Operating System is what it is.
https://metalab.at
34 stars 23 forks source link

Error in browser console when pressing Enter inside the event form #167

Open MaxValue opened 1 year ago

MaxValue commented 1 year ago

Observed in latest commit of main branch (6966640) as well as prod.

Steps to reproduce:

  1. Go to the calendar.
  2. Click "Create new event".
  3. Click in any text field.
  4. Press Enter.

Expected behavior: Event gets submitted to the server.

Actual behavior: Nothing happens visible to the user but an error is logged in the console.

The problem is that the oneliner in the onKeyPress attribute in the event form selects the form but then submits that object to the submit_form() function which tries to select the form again, because this submit_form() function actually expects a 'form type' and a 'form id' argument.

The easier solution I guess would be to just fix the oneliner (maybe convert it to a function which just gets called), since submit_form() is also used by projectinfo.inc.

ppiro commented 1 year ago

Event form submission is supposed to be done by submit_event, see the buttons at the bottom of the form. I believe the call to submit_form is a left over from previous times.

MaxValue commented 1 year ago

Ah ok, so should we change the call to submit_event or remove the "press enter to submit event" feature alltogether?