Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2015 at 17:13 UTC
Updated:
1 Nov 2016 at 19:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
megachrizT
This could result into a undefined variable error. If
$tokens['feeds-source']does not exist or the feed node failed to load, then$feeds_sourceis undefined.But the variable is used here in the patch:
I think that this needs a test for token replacement, to ensure that tokens like
[node:feed-source]and[node:feed-source:field_link]are replaced.I wonder though if these feed-source tokens are an exact copy of the feed-node tokens. The feed-node tokens become available when the entity module is installed. But existing sites may use these tokens, so I think we can not just delete them.
Comment #2
maximpodorov commentedHere is the updated patch which is free from these problems.
Comment #3
megachrizGreat! Thanks for the patch. I've created two tests for this issue: one to ensure tokens get replaced and one to check if there is a performance gain with the provided patch.
Two patches. The first is only the tests, for which
FeedsTokenTest::testPerformance()should fail, butFeedsTokenTest::testFeedsTokens()should pass. The second is with the fix included.Comment #5
megachrizI realized the automated test did not include token replacement for
[node:feeds-source], so I added that one toFeedsTokenTest::testFeedsTokens()as well.Comment #7
megachrizWhile I'm at it, the foreach loop could be killed as well. There is no need to go through the whole list of tokens if we are only looking for one in particular.
Comment #9
megachrizThank you tests! I indeed made a mistake in the last patch.
Comment #11
megachrizCommitted #9. And thanks for creating the fix, maximpodorov!
Comment #12
das-peter commentedAwesome guys, thank you so much for continuing this!