learnweb/moodle-mod_ratingallocate

dmlwriteexception if title too long

PhMemmel opened this issue · 0 comments

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.