I needed this for a project, so I thought I'd go ahead and create it and provide the patch. It's analogous to the existing "Country to ISO Code" plugin, but for U.S. States. For example, if your Feed has a "state" field that includes data like, "Connecticut", and "New Mexico", this plugin will convert them to "CT" and "NM" - suitable for mapping to fields provided by the Addressfield module.

Patch will be attached in first comment below.

Thanks,
-mike

Files: 
CommentFileSizeAuthor
#5 feeds_tamper-states-1963384-5.patch2.92 KBultimike
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-states-1963384-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#2 feeds_tamper-states-1963384-2.patch3.03 KBultimike
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-states-1963384-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 state_to_abbrev-1963384-1.patch0 bytesultimike
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

Comments

StatusFileSize
new0 bytes
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

...and here's the patch.

Thanks,
-mike

StatusFileSize
new3.03 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-states-1963384-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

...and how about a patch that actually works (oops)...

-mike

Status:Active» Needs review

Can you clean up the commented out function?
Also, are you sure about the t() wrapping the state name?

Status:Needs review» Needs work

Status:Needs work» Needs review
StatusFileSize
new2.92 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-states-1963384-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Chris,

Whoops - sorry about the commented out function. It's now removed in the attached patch.

As for the t(), I was unsure about it as well, but I modeled my patch after the country_to_code.inc plugin that already exists - that plugin uses the same pattern, including the t().

-mike

Version:7.x-1.x-dev» 6.x-1.x-dev
Status:Needs review» Patch (to be ported)

I should note that I've removed the t(). I need to check on the country to code plugin, but it doesn't really make sense, afaict.