Closed (duplicate)
Project:
Webform
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Jul 2007 at 21:20 UTC
Updated:
13 May 2012 at 04:52 UTC
I want to increase the max length of the 'label' for any given webform component. I found that this is stored in the 'webform_component' table as 'name'. This column lists a default value of 128. So this is rather simple to alter. However I don't see in the module or include files where to go to change the max length in the code itself for this particular form element. I tried just changing the database default, emptying cache, then re-editing the form, but the html still displays a max length of 128 for this field. Any suggestions?
Comments
Comment #1
roginald commentedSo I found in the module file code where I needed to make the change (I hope). Please let me know if this will cause problems, or if there is a more appropriate way to make this change, rather than modyfing the module code.
I added this line:
'#maxlength' => '255',
following this at line 914:
'#title' => t("Label"),
This, along with altering the field definition in the webform_component table for the 'name' field seems to be working.
Comment #2
ebeyrent commentedAny updates on this? I ran into the same issue, and used the method that roginald suggested. I hate hacking the module and the schema, and would love a better way to handle this problem.
Comment #3
ivrh commentedFind this piece of code (approx. line 900 in v.1.7 of webform.module file):
and insert '#maxlength' => '512', to look like this:
Comment #4
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
suit4 commentedFor me longer labels would be very helpfull, as far as I use the labels for questions, which might be longer than 255 chars.
Comment #6
LWVMD commentedI'd like to see both a Topic (currently the short label) and a full-length Question for each answer field.
Comment #7
quicksketchThe label field has been removed entirely and the 'markup' component has been put in place instead. There is no limit on text length for the markup component.
LWVMD, your request should be made a separate issue.
Comment #8
quicksketchOh I misread the issue. I though we were talking about the 'label' component. Not increasing the Label (or Name) column for all components. I'll make this a feature request.
Comment #9
cardell commentedFor anyone trying to address this issue in v2.x of webform, you have to make the change in webform_components.inc. Around line 229, you'll see:
Just like in the prior version, you add the following line to that array:
'#maxlength' => '512',
You also need to make the change in the database as noted above:
Comment #10
quicksketchI'm not really sure why this works for you. While extending the maxlength is definitely necessary, you should also have to update the database column to 255 since it's set to cap at 128 by default. I'd like to add this to webform, so any patches submitted that implement this and an upgrade hook for 2.x (both Drupal 5 and 6) will gladly be applied.
Comment #11
cardell commentedI did have to update the database column. The column changed to a text field in the db (instead of varchar) since I needed a field larger than 255 for some of my questions.
If I can find some time to figure out how to put together the patch and upgrade hook, I would love to help.
Comment #12
quicksketchThe label length has been increased to 255 in this patch: http://drupal.org/node/241319.
Comment #13
DrupalDan commentedHi guys,
Can anyone tell me how to increase the max length of the label in port 7?
Thanks in advance!
Comment #14
quicksketchPlease do not reopen ancient issues. The changes in the patches in #241319: Increase webform_component.name to 255 should provide you some guidance.