Is it possible to use longtext for poll answers?

Joseph Dietrich asked on June 14, 2017 23:46

Currently it seems that out of the box Kentico only allows text fields with a 200 character limit for Poll answers. Is there a setting to change this to allow for longer answers, or is this a hard limit? If the latter, is there a way of extending the Poll application so that we can allow it to accept larger answers?

Correct Answer

Trevor Fayas answered on June 15, 2017 05:32

I checked the Modules > Polls > Classes > Poll Answers, and indeed the text is set to 200 and you can't customize it (at least on 8.2, i don't have a k10 instance available in front of me).

The only thing i can think of is to override this manually, it's not really recommended though because your changes can be undone with hotfixes / upgrades.

But if you wish to attempt, you would have to adjust the database on the SQL server, then also look to the CMS_Class table, find the class for the Poll Answers, and adjust the Class FOrm Definition XML to set the text field to a larger amount or longtext.

Or you can try to manually set that class to be customizable, there's a setting in one of the tables (I think either in the CMS_Module or CMS_Class) that makes a module locked or not. If you can unlock it you can modify the class that way.

A slightly more 'proper' but bigger hassle is you could try to create a module to extend the Poll answers, but then you also need to adjust the form controls, the logic, and honestly wouldn't be worth it.

Sorry not a great answer, but it's an option.

1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.