Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Feeds creates a translation for every mapped language even if there is no content for a feed item in that language. It seems that preventing this has been attempted but the code isn't working correctly. I fixed this by fixing the empty check of the value; I'm not sure if this is what the code was supposed to do from the start.
Comment | File | Size | Author |
---|---|---|---|
#4 | interdiff-3-4.txt | 896 bytes | kekkis |
#4 | feeds_et-2652146-4.patch | 922 bytes | kekkis |
#3 | feeds_et-2652146-2.patch | 726 bytes | tommik |
#2 | feeds_et-2652146-1.patch | 547 bytes | ZeiP |
Comments
Comment #2
ZeiP CreditAttribution: ZeiP at Avoltus Oy commentedAttached is a patch to fix this.
Comment #3
tommik CreditAttribution: tommik at Avoltus Oy commentedCurrent patch prevents creation of empty translation, but it does not allow fields to be updated from having value to empty fields.
Altered patch so that is still prevents creation of empty translation but allow fields to be updated with empty values if the field exists.
Comment #4
kekkisAfter applying patch from #3 there is a line in mappers.inc that breaks PHP <5.5 compatibility.
That line (70) gives me a fatal on PHP 5.4. The error message says:
And the reason, of course, is that since
empty
is a language construct instead of a function, it cannot be called with other values than variables in versions prior to PHP 5.5. Per Drupal 7 system requirements, the minimum supported version should be 5.2.5 and this module's info file does not state a minimum PHP version so we should change the implementation to support 5.2.5. Attached you'll find a patch to work the same way, less concise, and compatible with PHP <5.5. See interdiff too.Comment #5
kekkisAnd of course one would forget to change back the status.