When having users enter data into their profiles, there is no way via the administration interface to restrict the number of characters. This attached patch provides this pathway. Also, the patch allows for updating the database schema. Finally, a length of zero specifies no limit.

CommentFileSizeAuthor
profile_module.patch5.82 KBkjmph

Comments

Anonymous’s picture

Version: 6.4 » 7.x-dev
Status: Needs review » Needs work

Feature requests go to the next version. Can you role the patch for HEAD please.

damien tournoud’s picture

Status: Needs work » Closed (won't fix)

The profile module is obsolete. Won't fix.

bartezz’s picture

Thanx for the patch!

hanskuiters’s picture

Thanx for the patch +1

rickh’s picture

Hey capono thanks for the patch. Tried it out but i got this error user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE fid = 7' at line 1 query: UPDATE profile_fields SET title = 'Short Description', name = 'profile_short', explanation = 'Give a short description of the band. Max 250 characters. The rest will be cut off from display.', category = 'General', weight = -9, required = 1, register = 1, visibility = 2, autocomplete = 0, options = '', page = '', length = 250, WHERE fid = 7 in /home7/freeedco/public_html/5storm/modules/profile/profile.admin.inc on line 355.

hanskuiters’s picture

The patch is from kjmph.

The error is caused by 'length = 250,'. It should be 'length = 250'. Without the comma. Did you patch by hand ;) ?

hanskuiters’s picture

Ooops, double post.

rickh’s picture

Hey Capono sorry for that. Yes I did patch by hand. I'll go through the process again and see if i've made a mistake somewhere.

rickh’s picture

Hey Capono, I did the patch again and it seems perfect. I forgot that I added the comma. Removed the comma and still get this error. Any help would be appreciated. This is a very useful function for me.

user warning: Unknown column 'length' in 'field list' query: UPDATE profile_fields SET title = 'Short Description', name = 'profile_short', explanation = 'Give a short description of the band. Max 250 characters. The rest will be cut off from display.', category = 'General', weight = -9, required = 1, register = 1, visibility = 2, autocomplete = 0, options = '', page = '', length = 250 WHERE fid = 7 in /home7/freeedco/public_html/5storm/modules/profile/profile.admin.inc on line 355.

hanskuiters’s picture

In the patch there is also something for the profile.install file. Patch that (maybe you did that already). Run update.php. That goes throught the install again and adds the 'length' field to the table.

rickh’s picture

i just had to run update. rookie mistake. sorry about that. thanks for the help.