Execute PHP in Tamper

Created on 23 May 2024, 4 months ago
Updated 12 June 2024, 4 months ago

Actually i use Drupal 10.2.4, Feeds 8.x-3.0-beta4 and Feeds Tamper 8.x-2.0-beta3.

I am working long time with feeds Tamper and Drupal 7.
There i use the plugin "Execute php code" for complecated tasks.

a simpe task for example with "Execute php code" is this one:

return '372145'.$field;

I cant see the plugin for Drupal 10.
How could i solve the example task without "Execute php code"?
Or ist there a sililar plugin, i oversee?

💬 Support request
Status

Fixed

Component

Plugins

Created by

🇩🇪Germany Lissy

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Lissy
  • Status changed to Fixed 4 months ago
  • 🇳🇱Netherlands megachriz

    It sounds like that your issue can be resolved with the "Rewrite" plugin. You can then type in something like 372145[field].

    If you need more advanced transformations of data, you could use an event subscriber in a custom module that acts on the parse event. The process of how to do that is described on https://www.drupal.org/docs/contributed-modules/feeds/feeds-howtos/alter...

    It is discouraged to have PHP code in the database or in config files as that could have a potential security risk. That being said, in some situations it could be practical, for example when you are tight on a deadline. But I think I don't want such plugin to exist in the Tamper module itself, for security reasons. For D7, this plugin was also in a separate project: https://www.drupal.org/project/feeds_tamper_php . You could ask there if they want to port the project to modern Drupal, if you find that you more often would need it.

  • 🇩🇪Germany Lissy

    Hi MegaChriz,
    Thank You very much.
    I could solve a few tasks, i former solved with execute php-Plugin now with Rewrite and with Find replace-Plugin.
    For a more complecated task i will use the event subscriber i a custom module.
    It is the right way.

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

Production build 0.71.5 2024