Max length possibly defaulting to 0

@angus

Image preview is now fixed, but I cannot submit the form, red box is shown around container without any error. I checked wizard settings and could not find the culprit:

To repro: Open https://cablogstaging.discoursehosting.net/admin/wizards/wizard/test_2_9 and type any text into composer and hit “Fertig”. Red box appears
Submitting works when composer is empty (0/0 chars) though.

Video demo of issue:
CleanShot 2022-08-25 at 15.01.30

Logs:

/var/www/discourse/app/controllers/static_controller.rb:160:in `read'


/var/www/discourse/app/controllers/static_controller.rb:160:in `block (2 levels) in favicon'


/var/www/discourse/lib/distributed_memoizer.rb:16:in `block in memoize'


/var/www/discourse/lib/distributed_mutex.rb:57:in `block in synchronize'


/var/www/discourse/lib/distributed_mutex.rb:53:in `synchronize'


/var/www/discourse/lib/distributed_mutex.rb:53:in `synchronize'


/var/www/discourse/lib/distributed_mutex.rb:38:in `synchronize'


/var/www/discourse/lib/distributed_memoizer.rb:12:in `memoize'


/var/www/discourse/app/controllers/static_controller.rb:138:in `block in favicon'


/var/www/discourse/lib/hijack.rb:56:in `instance_eval'


/var/www/discourse/lib/hijack.rb:56:in `block in hijack'


/var/www/discourse/lib/scheduler/defer.rb:94:in `block in do_work'


rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:284:in `with_connection'
rails_multisite-4.0.1/lib/rails_multisite/connection_management.rb:77:in `with_connection'
/var/www/discourse/lib/scheduler/defer.rb:89:in `do_work'


/var/www/discourse/lib/scheduler/defer.rb:79:in `block (2 levels) in start_thread'


The issue is that you’ve set both min length and max length to 0. If you remove 0 from the max length it will work (I just removed it and submitted the wizard on your site successfully). The validation error here needs to have a better message but it’s relatively straightforward in terms of the fix.

I can’t recally ever setting those values to 0. I left the field empty. Are there any particular situations where the values are set to 0 by default?

Yes it’s possible they’re incorrectly defaulting to 0. I’ll take a look at that. Moving this specific issue back to the custom wizard plugin.

I can’t reproduce it at this point. I will keep an eye on it and report here (or create new ticket, if you prefer that).

Cheers
Jr

Thanks. If you see it again, report it on this topic.