learnweb / moodle-mod_ratingallocate

:pray: "Fair allocation" moodle activity
https://moodle.org/plugins/view/mod_ratingallocate
20 stars 29 forks source link

dmlwriteexception if title too long #273

Closed PhMemmel closed 1 year ago

PhMemmel commented 1 year ago

Creating a choice throws a dmlwriteexception if the title is too long. The title is defined as VARCHAR(255) in the database schema. If the user tries to use an amount of characters above that limit, a dmlwriteexception will be thrown which is pretty bad especially when debugging is turned off, because the user does not receive any feedback about what's wrong.

Solution: The frontend (mform) needs to validate the correct length of the title. If not, notify the user about it.

This also applies to csv import. Here as well a check is needed and the issue should be reported to the user using the already implemented way of alerting the user about errors while importing.