Closed (won't fix)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 May 2008 at 17:03 UTC
Updated:
24 Jun 2011 at 11:01 UTC
Jump to comment: Most recent file
Comments
Comment #1
webchicksome_long_module_name_dynamic_content_field_some_long_field_name
That's about the only case I can think of that would require super long variable names. And that's only 64 characters.
If someone *really* has a use case for a variable named something longer than some_long_module_name_dynamic_content_field_some_long_field_name_dont_even_know_what_to_possibly_put_here_to_make_it_long_enough, then they should rewrite their logic because obviously something is wrong. :P
Won't fix, imo.
Comment #2
chx commentedComment #3
deekayen commentedThis is a live example:
node_privacy_byrole_default_grant_perms_content_type_content_canadian_signage_request
Namespace: node_privacy_byrole
Permission name: default_grant_perms
Content name (32 char limit): content_type_content_canadian_signage_request
In all, that's 86 characters, albeit well within the 128, but it's an example of how variable names can get long easily.
The system table allows 255 characters for storing the module config. If you remove sites/all/modules/ and .module, that leaves Drupal core support for the average site to allow for 229 characters as the module name as the allowable namespace minus the directory name of the module. Divide 229 by 2 (module directory and .module name) and the max allowed module name size (that would consume a variable namespace) would be 114 characters (give or take depending on where it's installed).
At 114 characters, appending one CCK content type to the variable name runs right past the 128 limit.
I use a real module named field_privacy_by_role_and_workflow_state. It might be nice at some point to have a variable name to set default values on a field:
field_privacy_by_role_and_workflow_state_content_type_content_canadian_signage_request_field_accounts_payable_email_address_visible
namespace: field_privacy_by_role_and_workflow_state
content type: content_type_content_canadian_signage_request
field: field_accounts_payable_email_address
permission name: visible
Total characters: 132
Obviously this isn't something I would be typing - it would be programmatically accessed, but that is a real module and real CCK stuff. As it is now, I would have to do some alternative like put part of it in an array. Let me remind you that the variable values are stored serialized, so to query that serialized data later outside the scope of variable_get() for a different purpose would make my eyes bleed and probably scare my coworkers.
So I ask if the field is varchar anyway, what's so special about 128? Why not 100 or 150? At least 255 is a limiter based on database design.
Comment #4
robloachWell, here's an untested patch.
Comment #5
jimkont commentedHi,
An example that variables needs to be bigger is the realname module where you store tokens to form the desired user name format.
since tokens strings are now (D7) bigger in size and we use more expressive user profile filed names the variable size is not enough...
cheers,
Dimitris
Comment #6
dimitris.spachos commentedSubscribing!