I think, spaces are also saved on postal code input on node save, that's why when used in views filter, typing 85704 won't show any result.

use trim() on node save.

Comments

rszrama’s picture

Title: Postal Code as views filter bug » Trim whitespace off addressfield input
Version: 7.x-1.0-beta3 » 7.x-1.x-dev
Category: bug » feature

This module doesn't do any processing of input - it just takes what the user enters and saves it. This is pretty standard behavior, so I don't see a bug in what it's doing. However, adding such a trim is a decent feature request, so I'm recategorizing this. In the meantime, you can update your Views filter to use the "Contains" operator instead of the "Is equal to" operator.

rszrama’s picture

Issue summary: View changes
Status: Active » Fixed

A recent commit just implemented hook_field_presave(), so I've added this trimming to it.

Commit: http://drupalcode.org/project/addressfield.git/commitdiff/8c0e233

Status: Fixed » Closed (fixed)

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