Closed (fixed)
Project:
Feeds Tamper
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Oct 2011 at 13:56 UTC
Updated:
26 Jul 2014 at 02:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
djalloway commentedFirst attempt, patch provided.
Comment #2
djalloway commentedused this on my current project, tested and confirmed working.
Comment #3
twistor commentedI'm still reluctant to include any kind of eval based plugins for three reasons:
As far as the code, wouldn't it make more sense to offer the replacement patterns as $variables inside the eval?
Comment #4
djalloway commentedI agree 100% with 1,2 and 3.
Maybe this is better suited right where it is, as an optional plugin.
Providing replacement patterns as variables is a great idea. Honestly, I was over deadline on this and just threw it together to accomplish what I needed, the thought process ending right there.
Any improvements are welcomed, I might even revamp this a bit, as it saves time on a lot of Data Migration use-cases.
Comment #5
foopang commentedHow do you use replacement patterns?
I tried to insert them into php code, but it's not working.
Comment #6
djalloway commented@beansboxchrispang In my migration project, I need to lookup/return the User ID using the Email address in my imported data, here is my code snippet.
You can see where I use the
[author]replacement field to replace the:mailtoken value in my query, then return the resulting field.Comment #7
_cosmos_ commentedI try this plugin and get error
this code i set to eval php textarea
?>
What i doing wrong?
Comment #8
djalloway commenteddid you apply the patch in #1 correctly to the 7.x.1.x-dev version of the Feeds Tamper module?
Comment #9
_cosmos_ commentedit works for me
пример кода в текстовом поле feeds_tamper
спасибо за плагин товарищам
Comment #10
mrfelton commentedThis doesn't quite work for my user case. In my case, I have an existing node that is being updated by feeds. The node has a multivalue field with a couple of values already set. When the feed runs I want to append any new values from the feed file to the multivalue field on the existing node, as additional values.
To do that, I need a way of accessing the node that is being updated and/or the field that is being updated so that I can grab the existing values, and merge them with the values in the feed.
Comment #11
mrfelton commentedI actually have this working now, with the following code in the php tamper rule, and then an explode rule after it. I had to make one modification to the code to get it to work with cvs imports, which was to run the replacement patterns through strtolower. same issue as in #1263718: Rewrite plugin fails when tokens contain upper case letters
Comment #12
dooug commentedI applied this patch to feeds_tamper. It seems to work for executing isolated php code, but in my case I need to modify the value of that mapper element. Like mentioned above, I tried using the replacement patterns provided, but they don't seem to be replaced. I also tried
dpm(get_defined_vars());with the devel module, but only some global configuration variables are available.I think this patch needs work to be able to execute code on the mapper element value. Correct me if I missing how to do this, please!
Comment #13
kenorb commentedI think for this, we should add some access control e.g.:
As it would be security risk for roles which has give the access to manage feeds.
Comment #14
quardzhere the module https://drupal.org/project/feeds_tamper_php
Comment #15
twistor commentedThis has a module now, so marking as fixed.