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.
Problem/Motivation
We have an XML file where the GUID is specified in the file name rather than in the XML. We're not able to change the XML feed but if we could alter the XML after it had been fetched then we could add it in
Proposed resolution
Add a new hook: hook_feeds_before_parse()
- This hook can be used to alter FeedsSource object that can be used to alter fetcher_result
API changes
hook_feeds_before_parse()
for altering the fetcher_result before generating the parser result
Comment | File | Size | Author |
---|---|---|---|
feeds-before-parse.patch | 505 bytes | vhin0210 | |
Comments
Comment #1
vhin0210 CreditAttribution: vhin0210 commentedComment #5
Josh Waihi CreditAttribution: Josh Waihi commentedI don't think these exceptions are related to this patch is it only adds a module hook. Perhaps there is some other issue with Feeds atm?
Comment #6
MegaChriz CreditAttribution: MegaChriz commented@Josh Waihi
No, code changes should always be tested against dev.
Comment #8
ryumkin CreditAttribution: ryumkin commentedSubscribe! There is another motivation, like faster CSV hash check, you could just take the string row calculate it's hash rather than calculate after parsing. Should be much faster!
Comment #9
joachim CreditAttribution: joachim commentedA new hook needs documenting in the api.php file.