UTF8 Field Length Protection
Votes: 10
Tags: Forms, Internationalization, plugin, manager, editing
Submitted: Jan 6, 2009
Released: Jan 6, 2009
Downloads: 93
License: GPL - GNU Public
UTF8 Field Length Protection 1.0
Works with the following Version(s):
Warns if too many characters are entered into a manager field by changing the background colour of the field to red.
Use to prevent bad truncation of strings when using using multibyte characters on UTF-8 encoded websites.
Download
- repo-2330.txt (93 downloads)
Description
* For UTF8 encoded websites.
* Changes the background colour of a field to red to warn if the number of characters entered would make the UTF8 byte stream exceed the maximum length allowed by the MODx mysql database definition.
* Assumes that the original field background colour is white.
* Fields checked: pagetitle, longtitle, description, alias, link_attributes, menutitle
* See the forum thread: http://modxcms.com/forums/index.php/topic,31507
Instructions
1. Create a new plugin.
Plugin name: UTF8 Field Length Protection
Description: <strong>1.0</strong> Warns if a manager field contains too many characters
2. Copy and paste the attached text file into the plugin code area.
3. On the System Events tab, check the OnDocFormRender event.

Please login to comment.