Just upgraded to v6.x-3.1 on a brand new site (empty db).

When I edit a new content type (admin/content/node-type/xxxxxx) for which Location settings have not been defined, I get the following error, and again on the next screen after updating and saving the location settings for the content type:

warning: trim() expects parameter 1 to be string, array given in /home/xxxx/public_html/sites/all/modules/location/location.inc on line 498.

Once the settings are saved though, the error does not appear again.

I am running:

  • Drupal 6.17
  • Ubuntu Lucid 10.04LTS
  • Apache
  • MySQL 5.1.4.1
  • PHP 5.3.2 as fcgid
Files: 
CommentFileSizeAuthor
#1 location-trim_warning-846604-1.patch865 bytesrooby

Comments

rooby’s picture

Status:Active» Needs review
StatusFileSize
new865 bytes

Wow I don't know how long that has been around.

Try this and see if it fixes your problem and doesn't cause others.
Seems to do it for me.

Carlos Miranda Levy’s picture

Thank you, this seems to fix it.
I have not receive any further errors.
The patch seems to work.

YesCT’s picture

Status:Needs review» Reviewed & tested by the community
rooby’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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

rooby’s picture

Status:Closed (fixed)» Fixed

The fix for this broke other things, see these issues:
#990804: When "Display full province name" is selected, parts of the administrative UI become disabled
#996898: State/province autocomplete not working

I have now committed a better fix that fixes those issues and this one.
The fix was taken from bdragon's DRUPAL-7--4 branch, where he had already fixed this.

http://drupal.org/cvs?commit=486596
http://drupal.org/cvs?commit=486594
http://drupal.org/cvs?commit=486600

Status:Fixed» Closed (fixed)

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