Subnet Limitation

Subnet Limitation

by Benjamin Dunn -
Number of replies: 3

Currently, subnet is defined as a varchar 255 for quizzes.  In my use case, I need to extend that to a varchar 2,000, which I hope will be enough to acommodate our campuses, but with continued growth, it may not.  My question is two fold:

1. If I change the structure of variable in the database to a varchar(2000), will it break anything else?  (Which includes the weekly builds we implement from Moodle 3.3 STABLE branch)

2. Does the form in the quiz where we set the subnet from have an input limitation which is coded other than from the definition of the field size set in the database.


Any answers from the development side would be greatly appreciated, as I am currently at 247 characters, and still need to add additional campuses, so have had to begin reducing security to entirely too many IP addresses.  ie. instead of 1.2.3.4, I have had to implement 1.2.3. just to cover what we have, and additional IP addresses are coming online as our needs grow.


Average of ratings: -
In reply to Benjamin Dunn

Re: Subnet Limitation

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I think just changing the size of the column in your database should be safe. I can't think of anything that would go wrong. I don't think browser limit text input boxes.

In reply to Tim Hunt

Re: Subnet Limitation

by Benjamin Dunn -

Thank you for the response.  PHP does allow a limit to be placed on the size of an input field, but it is usually put in place to avoid breaking something like these types of limits.  I hope fingers crossed that expanding the size of the field does not cause issues, but I am not sure where else to ask, and I do know you answer a LOT of questions on here, so I will have faith that this will resolve my issue without creating new ones.

As an aside, would I be safer to request an improvement in tracker to be certain it would not cause issues, or is it a try and hope for the best by making the change and seeing if anything goes wrong?