Plugin settings page, apparent limit on length of textarea fields

Description of issue or problem I’m having:
I have a textarea field in my plugin settings page, and have pasted in some content that is to be injected into the page template at display time. The textarea content is being cut off at 65526 characters, basically 65k. Is this a hard limit on content that can be pasted into a textarea field in a settings form?

Steps I took leading up to the issue:
Created a settings form and pasted in around 100k of text. a long list that is to be displayed on the frontend. The text was being cut off at 65k.

What I tried to resolve the issue:
I have looked on the forums but can’t find anything related to this.

Application Version - e.g., OJS 3.1.2:
OJS 3.3.0.10

Does anyone know of a way to allow textarea fields to accept more text?

Hi @Ant_Forshaw,

Just ran this by our developers, who had this to say:
“There’s no limit coded into OJS; it’ll be coming from another part of the stack (PHP, Apache or equivalent, possibly even TinyMCE).”

-Roger
PKP Team

Thank you @rcgillis , it looks like the culprit is MySQL and the setting value, which is of type TEXT (65K max size).

Do you think it will be safe for me to alter the table to use MEDIUMTEXT or LONGTEXT instead of TEXT? (I don’t want to break OJS :))

Further to my last reply, I used PhpMyAdmin to alter the table and change the settings type from text to mediumtext. The text field accepted the longer value, so I’m happy there. I’m slightly wary of doing this however as future updates to OJS may likely revert the var type back to text.

Is this something that the core developers would consider as a feature request? To change the field type for the settings table to mediumtext instead of just text?

Hi @Ant_Forshaw,

Glad to hear that you’ve made some progress. About the wariness related to future updates, and this being a feature request, I’ll flag this for our developers to have a look at and respond to when they get a chance.

Best regards,

Roger
PKP Team

2 Likes

That’s brilliant, thanks @rcgillis

Do you think it will be safe for me to alter the table to use MEDIUMTEXT or LONGTEXT instead of TEXT? (I don’t want to break OJS :))

Upgrade to the future 3.4 should run OK but there is no guarantee it won’t require some tweaks in the migration script in later versions.

Another solution could be creating own table by the plugin.

I don’t think my OJS-fu is strong enough yet :smiley:

1 Like

See related: Change table publication_settings > setting_value datatype from TEXT to MEDIUMTEXT - #3 by asmecher