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.
Follow up to #2049085: Inject database dependency into AggregatorFeedBlock derivative class
Problem/Motivation
Drupal\aggregator\Plugin\Derivative\AggregatorFeedBlock is querying the aggregator_feed table.
Proposed resolution
We have a FeedStorageController. Let's use it.
Remaining tasks
Move the queries from AggregatorFeedBlock to FeedStorageController.
User interface changes
API changes
Related Issues
Comment | File | Size | Author |
---|---|---|---|
#2 | 2085197-feedblock-storage-2.patch | 5.21 KB | kim.pepper |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedalso as part of #2068325: [META] Convert entity SQL queries to the Entity Query API (we already have a major open for this)
Comment #2
kim.pepperThis simply moves the db queries into FeedStorageController. Not sure how to do the entity query stuff in #1.
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedso the more i look at this query the more i think we can replace this with just an aggregator_feed_load($derivative_id) and then just check $feed->block->value and bail out
This i would call it loadBlockEnabled()
Those methods from the feed storage should return a full loaded entity, so we can also standarize on calls like id() or label()..fetchObject only gives an stdClass.
You can check
\Drupal\aggregator\Form\OpmlFeedAdd
to see how ti worksFinally though:
I noticed that #1888702: Use configuration selection instead of derivatives for some blocks kills both those queries and i think it will eventually get in, so we should probably postpone this issue
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedyeap, those classes where removed