I have a CSV feed importer for importing products into a site. One of the columns in the CSV is "SKU #". When I try to add a Feeds Tamper plugin to this field, it is added to the database with a source name of "SKU " (it drops the "#"). This causes it to not show up in the UI list of plugins, and prevents the same plugin to be added again (because of machine name conflict).

Editing the database directly and adding the "#" back to the source name fixes it. So it must be something to do with the function that saves it to the database. It is getting filtered out somehow.

I'm rushed to get this project out the door right now, but I'll try to dig in a little deeper later and see if I can isolate/patch...

Comments

m.stenta’s picture

Hmm, alright this might not be Feed Tamper's fault.

The problem is that Feeds Tamper's link for adding a plugin to the "SKU #" field looks like this:

http://[site-address]/admin/build/feeds/tamper/add/[feed-id]/SKU%20%2523

When that gets passed into the page callback function (feeds_tamper_ui_add_plugin_form()), it comes in as simply "SKU "... which is what gets passed to the database.

So it seems that it has more to do with the way URL variables are passed into functions, but perhaps there's no way around this. It isn't Feed Tamper's fault, but it is it's problem... because it doesn't provide any kind of protection against this kind of thing, and once it gets inserted into the database there's no helping it, unless you have access to the database and enough know-how to deal with it (which should never be a module's assumption).

Any ideas on a good way to validate for this kind of thing? Some way of notifying users that fields with "#" in them are a no-no?

twistor’s picture

Assigned: Unassigned » twistor
Status: Active » Postponed (maintainer needs more info)

I just tested this out on 6.x-beta4 with the source "stuff #". Are you sure you're using beta4? There was a new release recently.

m.stenta’s picture

Status: Postponed (maintainer needs more info) » Active

Yep: 6.x-1.0-beta4

I think it's mainly the link that appears on /admin/build/feeds/tamper/list/%feeds_importer that passes the $source variable into feeds_tamper_ui_add_plugin_form().

I put a "dpm($source);" at the beginning of feeds_tamper_ui_add_plugin_form() and it prints out as "SKU " when I click on the "Add Plugin" link for that field.

twistor’s picture

Status: Active » Closed (cannot reproduce)

Is this still a problem?

Cleaning up issues. Feel free to re-open.