* document blank sources - i only found them in the source
* "available tokens" tells us "[blank source foo]" - what works is "[Blank source Foo]"

Files: 
CommentFileSizeAuthor
#15 feeds_tamper-blank-source-1515316-15.patch10.88 KBtwistor
PASSED: [[SimpleTest]]: [MySQL] 935 pass(es).
[ View ]
#14 2013-09-20-Screen Shot 2013-09-20 at 3.35.29 PM.jpg108.94 KBJohn Bickar
#14 2013-09-20-Screen Shot 2013-09-20 at 3.35.07 PM.jpg182 KBJohn Bickar
#11 feeds_tamper-blank-source-1515316-11.patch4.5 KBtwistor
PASSED: [[SimpleTest]]: [MySQL] 824 pass(es).
[ View ]
#9 feeds_tamper-blank-source-1515316-9.patch4.49 KBtwistor
FAILED: [[SimpleTest]]: [MySQL] 701 pass(es), 87 fail(s), and 13 exception(s).
[ View ]
#8 feeds_tamper-blank-source-1515316-8.patch3.64 KBtwistor
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]
#7 feeds_tamper-blank-source-1515316-7.patch1.14 KBosopolar
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]
#2 feeds_tamper-blank-source-rewrite-1515316-2.patch473 bytestwistor
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-blank-source-rewrite-1515316-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#1 0001-fixed-1515316-Blank-source-Foo-broken.patch1010 bytesaxel.rutz
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

Comments

Title:'Blank source Foo' documentation and token bug'Blank source Foo' broken
Priority:Normal» Critical
Status:Active» Needs review
StatusFileSize
new1010 bytes
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

also such items fail to import completely, so setting critical.

here is a simple patch that fixes all said issues for me.

StatusFileSize
new473 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch feeds_tamper-blank-source-rewrite-1515316-2.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Hey, can you try this one?
We REALLY need a better way to handle the friggin' CSV parser.

This is not only a problem with Rewrite plugin, it's a problem with FeedsCSVParser+all plugins (eg.: Rewrite, Copy source value, etc.). As I see element keys are converted lowercase for FeedsCSVParser, except for 'Blank source Foo', except for some other place, where even 'Blank source Foo' should be lowercase. This is madness for me, as I'm new to Feeds and Feeds Tamper internals.
Couldn't it be handled centrally? Even when all Feeds Tamper plugins handle the case correctly, my values are not written to my target entity, because FeedsCSVParser has this override:

<?php
 
/**
   * Override parent::getSourceElement() to use only lower keys.
   */
 
public function getSourceElement(FeedsSource $source, FeedsParserResult $result, $element_key) {
    return
parent::getSourceElement($source, $result, drupal_strtolower($element_key));
  }
?>

$element_key is 'Blank source Foo', $source has it as 'Blank source Foo', but FeedsCSVParser converts it to lowercase, so my source value is lost. What is the correct solution? Should Feeds be aware of Feeds Tamper 'Blank source Foo', or should the whole thing be handled somehow in feeds_tamper_feeds_after_parse()? With the second solution (if it is possible), other plugins wouldn't need to handle FeedsCSVParser as an exception.

If I can help, I will try, but I will have to find and go through places that affect $element_key case handling in a code mostly unknown for me.

I removed the solution in #2 from the current 7.x-1.x-dev, patched it with #1 and my problem was solved. Before I looked at patch in #1, I also came to that solution myself.
However, this solution doesn't remove the need for all plugins to handle element keys differently for the CSV parser, but they don't need to have an exception for blank sources from the CSV special handling.

I've reinvent the weel :) in another issue http://drupal.org/node/1938940 and had fixed there this issue too.

#1 works for me.

Status:Needs review» Reviewed & tested by the community

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new1.14 KB
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

I combined patch from #1 and #2 to just one patch and did a little code formatting. Please review again.

StatusFileSize
new3.64 KB
PASSED: [[SimpleTest]]: [MySQL] 821 pass(es).
[ View ]

Can someone try this?
Trying to clean up some hacks. This should fix quite a few bugs.

StatusFileSize
new4.49 KB
FAILED: [[SimpleTest]]: [MySQL] 701 pass(es), 87 fail(s), and 13 exception(s).
[ View ]

Initialize every source value.

Status:Needs review» Needs work

The last submitted patch, feeds_tamper-blank-source-1515316-9.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new4.5 KB
PASSED: [[SimpleTest]]: [MySQL] 824 pass(es).
[ View ]

Well, that's easily fixable.

Status:Needs review» Needs work

The last submitted patch, feeds_tamper-blank-source-1515316-11.patch, failed testing.

Status:Needs work» Needs review

Trying to test this so that we can get a point release, but I can't make heads or tails of the issue summary.

Here are a couple of screenshots from simplytest.me with the patch added; I can't see "Blank source Foo" anywhere.

StatusFileSize
new10.88 KB
PASSED: [[SimpleTest]]: [MySQL] 935 pass(es).
[ View ]

The bug is solved, I just needed someone to test existing installs to make sure the fix doesn't have any unexpected side effects.

I've added more test coverage. Assuming this comes back green, I will commit it and roll the release on Monday.

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

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

After updating to this version, one of our mappings broke. We have an RSS category mapped to a Tags field on the Article content type. We used tamper plugins to Implode the array into a string (separated by newlines), Rewrite the string to add a term, do several Find/replaces on some terms, and finally Explode the string back into an array. After updating to 1.0-beta5, rewriting and find/replace no longer work, and the data gets imported as-is from the source. The Find/replace plugin now generates the following error:

Warning: Invalid argument supplied for foreach() in feeds_tamper_feeds_after_parse()

Drupal core 7.26
Feeds 2.0-beta8
Feeds Tamper 1.0-beta5

The commit immediately before the one that applies the patch for this issue works fine.