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.
Aggregator exposes a block per feed. Sites with 1000 feeds will have 1000 aggregator blocks on admin/build/block - this does not scale.
I for one would be all for removing this feature altogether.
I'm guessing there will be some objection to removing. At least we need to decouple block generation from feeds present in system. Ideas for UI?
Comment | File | Size | Author |
---|---|---|---|
#21 | aggregator-block-options-398556-21.patch | 2.97 KB | hussainweb |
#20 | aggregator-block-options-398556-20.patch | 2.99 KB | hussainweb |
#14 | 398556-11.patch | 2.18 KB | Jody Lynn |
#11 | aggregator-398556_11.patch | 4.64 KB | drzraf |
#8 | aggregator-398556_8.patch | 4.42 KB | drzraf |
Comments
Comment #1
geodaniel CreditAttribution: geodaniel commentedSetting the 'News items in block' option to 0 stops it from exposing the block already... that could just be set to default to 0 instead of 5. Perhaps better would be to add a 'Create block of feed items' checkbox and, if checked, expose the select box to choose how many items get shown?
Comment #2
alex_b CreditAttribution: alex_b commented#1:
It's kind of weird in the first place that the presentation in a block is part of the feed settings. I'd rather remove the block setting entirely from the feed form and replace it by a new tab on admin/build/block/add
http://skitch.com/alexbarth/b8amh/blocks-localhost ?
Comment #3
Jody LynnThe same is true for menu module and its block creation.
I think the 'Create block of feed items' checkbox is right on, and a similar checkbox could be added to menus as well.
The 'news items in block' field and its lame outdated and complicated description: "Drupal can make a block with the most recent news items of this feed. You can configure blocks to be displayed in the sidebar of your page. This setting lets you configure the number of news items to show in this feed's block. If you choose '0' this feed's block will be disabled." should be reimagined as a block setting, and there should be a link from aggregator feed editing to this block configuration page when a block has been created.
Comment #4
sheise CreditAttribution: sheise commentedHere's an attempted patch.
This patch:
- Replaces the "Number of items to display in the feed’s block" setting on the feed with a checkbox for creating a block.
- Hijacks the aggregator_feed "block" db column for this purpose and also adds a new "items" column.
- Add "Number of items" setting on the block settings page.
This all seems to work ok, except if you have placed a block somewhere and uncheck the setting to create block, errors will then appear on the page. This is the first work I've done on D7 so I wonder if it's something with the new db layer that I am unfamiliar with.
Comment #5
Jody LynnExisting issue, but there should be a new line after each array( in this function
Have it default to 1 if $feed->block is not set to match current behavior.
Use a new variable to store the new block configuration settings to be consistent with other modules' block configs
default value should be 5 if it is not set
replace this array with range(1, 20)
extra whitespace
You also need to alter aggregator_feed_save to delete the block if the option is unchecked.
Powered by Dreditor.
Comment #6
sheise CreditAttribution: sheise commentedOk, here's a second patch with the changes suggested by Jody Lynn.
Comment #7
Jody LynnRemove the extra line break.
Needs a line break between array( and '#type' (and likewise for the other form elements in this function)
Don't put number 1 in quotes.
'Whether a block has been created' implies a history exists between this data record and block creation. Maybe something like 'Boolean indicating if there should be a corresponding block for this feed.'
Add an underscore in the variable name, aggregator_block_items_
Need a space: range(1, 20)
Watch the trailing whitespace (look at it in dreditor)
variable_get always needs to have its default value as the second parameter (5 in this case)
if (!$edit['block']) is more compact
watch the trailing whitespace
It looks like there are actually two different ways to make blocks: aggregatory categories and aggregator feeds, so this needs to be extended to work with both ways.
Also, for the new variables, they need to be deleted when a feed/category is deleted, and on hook_uninstall.
Powered by Dreditor.
Comment #8
drzraf CreditAttribution: drzraf commentedrerolled (against D7 but still patch with relative paths) to address issues from #7 except :
new variables, they need to be deleted
=> added variable_del() when the block is disabled
That means that this settings is not stored across activation/deactivation of a block
But we can't know which variables id are left at module deactivation time
aggregatory categories and aggregator feeds, so this needs to be extended to work with both ways.
=> is this really needed, ie dozens of categories ?
Comment #9
ParisLiakos CreditAttribution: ParisLiakos commentedComment #11
drzraf CreditAttribution: drzraf commentedComment #12
ParisLiakos CreditAttribution: ParisLiakos commentedThe change should go in d8 first..it is too late to add features to d7
Comment #13
drzraf CreditAttribution: drzraf commentedthen just count me as a bug reporter
Comment #14
Jody LynnIt looks like when the new block system went in, the ability to configure the number of items shown per block already went in.
However, the old aggregator settings to configure the number of items per block were not removed although they no longer work, so this is now a bug.
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedI guess we dont need an upgrade path here (this should happen here? #1871700: Provide an upgrade path to the new Block architecture from Drupal 7), but we should update entity storages/forms as well
Btw, see also #1888702: Use configuration selection instead of derivatives for some blocks
Comment #16
xjmNote that we'll also probably be converting these blocks to views.
Comment #17
xjmComment #18
hussainwebI see that this issue will help in cleaning up a test in
AggregatorRenderingTest
. The test passes, but does not catch an error.I observed it when working on #2047593: Inject dependencies into EntityDerivative derivative class. Like I said, the test had passed but I saw an error when checking the verbose output. I then wondered why was the block count repeated in two places, and then I found this issue.
I will work on this patch tonight and add/edit relevant tests.
Comment #19
hussainwebI think this should count as major due to its nature and various relations to other issues in queue.
Comment #20
hussainwebDoing a reroll first.
Comment #21
hussainwebMissed a small thing... Attaching the fix.
Comment #22
Berdir#1888702: Use configuration selection instead of derivatives for some blocks is RTBC and solves this problem by only offering a single aggregator block which you can then configure to use a given feed or category (one block for each) and removes that option from feeds completely.
Re-introducing that as a checkbox would IMHO be a feature, feel free to re-open if you want that, closing for now.