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.
When I used this with a recent version of Feeds (7.x-2.0-alpha8+33-dev), the $values passed to callback is an array instead of a string.
Attached patch uses reset() to grab first item from $values array.
The example my_module_set_target() in feeds.api.php uses this same method.
Tested and now deployed on a site that imported a few hundred users using this module.
Comment | File | Size | Author |
---|---|---|---|
#1 | incorrect_implementation_of_callback-2339555-1.patch | 1.28 KB | krisahil |
Comments
Comment #1
krisahil CreditAttribution: krisahil commentedComment #2
manuel_mra CreditAttribution: manuel_mra commentedI really wanna thank you with this patch.
I was trying many differents ways and using many time.
Thank you.
Comment #3
thatpixguy CreditAttribution: thatpixguy commentedThanks! I needed to re-do an import I made a few months ago and was scratching my head wondering why it wasn't working :)
Comment #4
rcodina CreditAttribution: rcodina commentedPatch on #1 works for me too. I use Feeds 7.x-2.0-alpha8+84-dev.
I mark this issue as RTBC due to two previous comments and mine.
Thank you so much @krisahil. Let's hope mantainer commits this at some point.
Comment #5
retiredpro CreditAttribution: retiredpro commentedPatched from #1 but still was not working for me.
I uploaded my images to sites/default/files folder but the import was not recognizing them. Instead, it was generating empty target picture files upon import.
Included is a patch that worked for me. I changed it to specify the default files folder as the source.
Comment #6
rcodina CreditAttribution: rcodina commented@retiredpro Have you used the file mapper?
I think your patch is too specific. I show first patch again which is already RTBTC.
Comment #7
retiredpro CreditAttribution: retiredpro commentedFor some reason, my original reply attached twice and re-referenced the original patch.
@rcodina, I mapped my csv column name to the target User Picture. Is that what you mean? I couldn't find any information on where or how to specify where my source images were located. I assumed my source images should have been in /sites/default/files but it didn't seem to find it. Which is why i defined the default files folder as the source in my patch.
Comment #8
rcodina CreditAttribution: rcodina commented@retiredpro You have to provide a full URL to your files. This is how it's meant to be used (like standart's feeds module's file/image mappers)
Comment #9
retiredpro CreditAttribution: retiredpro commentedThanks for the info, @rcodina.
Comment #10
rcodina CreditAttribution: rcodina commented@retiredpro No problem
Comment #11
troybthompson CreditAttribution: troybthompson commentedHas anyone gotten this module to work in the latest feeds, 7.x-2.0-beta1 ? I've tried the patches and I'm using full URLs, tried the tamper explode, and when I check file_managed I don't see the file there but with the wrong uid either. Anything I'm missing?
Comment #12
webservant316 CreditAttribution: webservant316 commentedThe same problem observed here. I was able to get it working with a similar fix...
However, I am creating another issue, because this module is working properly to create new users through feeds, however, updates to existing users is causing the picture to be totally lost.
I am using feeds 7.x-2.0-beta1.
Comment #13
webservant316 CreditAttribution: webservant316 commentedraising to major, since module is not functioning until this is fixed.
Comment #14
webservant316 CreditAttribution: webservant316 commentedany help here?
Comment #15
vistree CreditAttribution: vistree commentedSame problem here. Only ways to solve: incluede #12 on your own or use tamper module to get string from array.
Comment #16
rcodina CreditAttribution: rcodina commentedYou are right, this is not working on latest beta1 of Feeds. The patch on #15 on the related issue works for me on beta1. I close this issue as a duplicate.