Mailu / Mailu

Insular email distribution - mail server as Docker images
https://mailu.io
Other
5.83k stars 830 forks source link

[admin] edit alias, user or domain fails #152

Closed hoellen closed 7 years ago

hoellen commented 7 years ago

Hello,

if you want to edit an existing alias, user or domain in admin panel, you can't save the new data because you get the error message 'This field is required.'

greets hoellen

kaiyou commented 7 years ago

I cannot reproduce this, would you please provide some steps? Also, what browser are you using, and is Javascript enabled?

trueserve commented 7 years ago

I can reproduce this.

Steps to reproduce:

  1. Edit an account of some type, where the account name on the edit screen is an uneditable field (such as /admin/user/edit/acct@domain.com or /admin/domain/edit/domain.com)
  2. Save changes by clicking Save Settings or the erroneous "Create" button
  3. The uneditable name field is now empty, highlighted, and has the error "This field is required."

Expected result:

  1. Changes are saved.

    fail_message

hoellen commented 7 years ago

The image shows exactly what i mean. I use Firefox 50.1.0 with uMatrix (like NoScript) but all scripts are enabled. Server: Mailu:stable with Docker 1.13.0

kaiyou commented 7 years ago

Okay, I managed to reproduce that behaviour on Chromium as well but I cannot isolate why yet. Working on it right now, thank you for reporting!

kaiyou commented 7 years ago

I isolated the behaviour to that commit : https://github.com/kvesteri/wtforms-components/commit/5083591825aeb7681b7819603ed0cf7ea6f6a3f9

Because the field is disabled, the input is not sent when the form is validated, thus affecting validation.

kaiyou commented 7 years ago

I just pushed a fix to master, disabling validation for these specific fields when they are disabled. This should not cause any security issue because disabling the field also disables the populate_obj from the field.

I will deploy on my side, could you try as well so that we can backport this quickly to stable?

kaiyou commented 7 years ago

I also reported the change in behavior to the developers of WTForms Components.

hoellen commented 7 years ago

I tested users, aliases and domains and it worked. Thanks.

kaiyou commented 7 years ago

I just pushed to stable after some testing.