If you want to do something like create a feed and then immediately refresh it, you can't, because you don't have access to the feed ID of the feed you just created.

Here's a simple patch to solve this problem. Should be harmless for a D7 backport as well.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aron Novak’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
594 bytes

Seems to be RTBC, but what about adding basic doc in the top?

David_Rothstein’s picture

Looks good to me too, but a minor nit: "id" should be capitalized in the docs. Fixed in the attached patch.

Dries’s picture

Back from vacation. Still catching up on e-mail but getting my legs warmed up with some simple patches. Committed to 8.x.

I didn't commit it to 7.x though as it is a small API change. Up to webchick to decide.

Dries’s picture

Version: 8.x-dev » 7.x-dev
sun’s picture

Version: 7.x-dev » 8.x-dev
Status: Reviewed & tested by the community » Needs work

Why do we suddenly introduce a new pattern for save functions here?

Our existing pattern is to take &$edit by reference and assign the ID to the designated key.

ParisLiakos’s picture

Version: 8.x-dev » 7.x-dev

no more aggregator_save_feed in d8, so moving back to d7

larowlan’s picture

Issue tags: +Needs tests

So putting & in-front of $edit argument should be enough here.
Will look at this on Monday.

larowlan’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -Needs backport to D7
FileSize
1.46 KB

This passes $edit by reference to aggregator_save_feed so we get the fid back.
Adds a test to verify.

Status: Needs review » Needs work

The last submitted patch, aggregator-save-feed-1266322.8.patch, failed testing.

Elin Yordanov’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
594 bytes

One year, no advance. Proposal of @webchick was ok and passed the test. I don't understand why there must always be someone against a very basic one-liner solution and such a very simple patch must wait for more than 3 damned years to be commited!

I've rerolled @David_Rothstein's patch. Please review and commit.

  • Dries committed a3769a4 on 8.3.x
    - Patch #1266322 by webchick: return feed ID after saving.
    
    

  • Dries committed a3769a4 on 8.3.x
    - Patch #1266322 by webchick: return feed ID after saving.
    
    

  • Dries committed a3769a4 on 8.4.x
    - Patch #1266322 by webchick: return feed ID after saving.
    
    

  • Dries committed a3769a4 on 8.4.x
    - Patch #1266322 by webchick: return feed ID after saving.
    
    

  • Dries committed a3769a4 on 9.1.x
    - Patch #1266322 by webchick: return feed ID after saving.