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.
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.
Comment | File | Size | Author |
---|---|---|---|
#10 | aggregator-save-feed-should-return-fid-1266322-10.patch | 594 bytes | Elin Yordanov |
#8 | aggregator-save-feed-1266322.8.patch | 1.46 KB | larowlan |
#2 | 1266322_aggregator_save_fid-2.patch | 594 bytes | David_Rothstein |
#1 | 1266322_aggregator_save_fid-1.patch | 594 bytes | Aron Novak |
aggregator-save-fid.patch | 321 bytes | webchick | |
Comments
Comment #1
Aron NovakSeems to be RTBC, but what about adding basic doc in the top?
Comment #2
David_Rothstein CreditAttribution: David_Rothstein commentedLooks good to me too, but a minor nit: "id" should be capitalized in the docs. Fixed in the attached patch.
Comment #3
Dries CreditAttribution: Dries commentedBack 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.
Comment #4
Dries CreditAttribution: Dries commentedComment #5
sunWhy 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.
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedno more aggregator_save_feed in d8, so moving back to d7
Comment #7
larowlanSo putting & in-front of $edit argument should be enough here.
Will look at this on Monday.
Comment #8
larowlanThis passes $edit by reference to aggregator_save_feed so we get the fid back.
Adds a test to verify.
Comment #10
Elin Yordanov CreditAttribution: Elin Yordanov commentedOne 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.