The database allows 255 chars for city, street, etc, but FAPI tries to restrict this. No good reason to do that, IMO.

Comments

ankur’s picture

Status: Needs review » Fixed

Applied to DRUPAL-5 branch. Thanks for the patch.

Anonymous’s picture

Status: Fixed » Closed (fixed)
landry’s picture

Version: 5.x-1.x-dev » 6.x-3.x-dev
Status: Closed (fixed) » Active

#maxlength=64 is still in use for those fields in 6.x. Reopening and reassigning. There's no good reason to limit the form field to 64 for name/street/additional/city when 255 is allowed in db...

bartezz’s picture

+1 encountered this too and it's annoying :) for now working with webdeveloper toolbar in Firefox to unset the maxlength...

dboulet’s picture

Status: Active » Needs review
StatusFileSize
new1.67 KB

New patch for 6.x-3.x-dev.

yesct’s picture

Status: Needs review » Reviewed & tested by the community

code looks good, just removes the lines as in the previously committed to 5.x patch. (I did not try to apply it to the current dev, I just looked at the patch)

I did check the cvs repository for 6 and those max lines are still in them, so it looks like this is needed.

hutch’s picture

Tested patch in #5, applied cleanly ;-)

heine’s picture

Status: Reviewed & tested by the community » Needs work

As the default #maxlength of a textfield is 128, you might want to keep the property and set it to 255.

hutch’s picture

StatusFileSize
new1.82 KB

True enough, here is a patch to do it that way, let the maintainer decide ;-)

yesct’s picture

+++ location.module	26 Jun 2010 09:10:28 -0000
@@ -603,7 +603,7 @@ function location_locationapi(&$obj, $op
+            '#maxlength'      => 255,

is it 255 or 256? I'll go check.

Powered by Dreditor.

yesct’s picture

Status: Needs work » Reviewed & tested by the community
+++ location.module	26 Jun 2010 09:10:28 -0000
@@ -603,7 +603,7 @@ function location_locationapi(&$obj, $op
+            '#maxlength'      => 255,

is it 255 or 256? I'll go check.

seems like 255. :)
is this the right place to check?
http://drupalcode.org/viewvc/drupal/contributions/modules/location/locat...
lines 401-404

Powered by Dreditor.

hutch’s picture

Yep right place to check, on lines 48 - 75 for mysql and 401 - 404 for the update
255 for name, street, additional and city. province and postal_code are length 16, may as well apply those too.

On second thought province is autocomplete so perhaps should be left to 64 in case it interferes
And postal_code already is 16

rooby’s picture

Status: Reviewed & tested by the community » Fixed

The original commit must have been lost at some point.
Committed to 5, 6 & 7.

http://drupal.org/cvs?commit=387906
http://drupal.org/cvs?commit=387904
http://drupal.org/cvs?commit=387902

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.