In PHP we have sprintf function that can help to format some data before output. It is general function, so I think it should be added to feeds_tamper.

Go to link to see a lot of usage examples.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

5n00py’s picture

Maybe it need tests or rename plugin ???

twistor’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests
  1. +++ b/plugins/sprintf.inc
    @@ -0,0 +1,27 @@
    +<?php
    +
    +$plugin = array(
    

    Can we get an @file doc?

  2. +++ b/plugins/sprintf.inc
    @@ -0,0 +1,27 @@
    +    '#title' => t('Formar'),
    

    *Format

  3. +++ b/plugins/sprintf.inc
    @@ -0,0 +1,27 @@
    +    '#required' => TRUE,
    

    We can't make this required. I believe it will break the ajax.

This also needs some tests. They should be pretty basic.
See feeds_tamper_plugins.test and add one there. I've been trying to keep them in alphabetical order.

Thanks!

5n00py’s picture

Hi Twistor, thanks for fast and good review.

I made all changes from #2, but I did not run tests on my local machine. I hope i write it right ))
Just see new patch.

5n00py’s picture

Status: Needs work » Needs review

Oops

twistor’s picture

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

Changed around some of the wording. Some other just snuck in there as well.
7.x http://drupalcode.org/project/feeds_tamper.git/commit/ef80725

Thanks!

twistor’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes
Status: Patch (to be ported) » Closed (fixed)

I'm not backporting plugins anymore at this point.