Problem/Motivation


Aggregator does not output item links in the feed block.

Proposed resolution

Fix it

Remaining tasks

Review
Commit

User interface changes

The links are actually shown.

API changes

None

Comments

ParisLiakos’s picture

Issue summary: View changes
StatusFileSize
new15.78 KB
ParisLiakos’s picture

Status: Active » Needs review
StatusFileSize
new929 bytes
new2 KB

The last submitted patch, 2: drupal-aggregator-2429501-FAIL.patch, failed testing.

bill richardson’s picture

confirm patch fixes problem.

japerry’s picture

Priority: Normal » Major
Status: Needs review » Needs work

Related to #1763964: Use #type => link for theme_aggregator_block_item(), should be an easy fix.

+++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
@@ -170,9 +171,13 @@ public function build() {
-          '#href' => $item->getLink(),
+          '#url' => Url::fromUri($item->getLink()),

Can't we just do this instead?

  '#url' => $item->urlInfo(),
mitrpaka’s picture

Status: Needs work » Needs review
StatusFileSize
new1.98 KB
new597 bytes
eclipsegc’s picture

Priority: Major » Critical
StatusFileSize
new1.74 KB

Ok, I'm removing an extraneous use statement we no longer need. I'll let it come back from NR, but this should be RTBC at this point.

Testing this and it works as advertised and fixes a big bug in HEAD. I'd say this falls within the criteria for critical since it "Render a system unusable and have no workaround." Aggregator block is definitely unusable at this point.

Eclipse

eclipsegc’s picture

Status: Needs review » Reviewed & tested by the community

Since I only removed a use statement, I feel comfortable RTBCing this patch.

Eclipse

japerry’s picture

+1 tested looks good. Without this patch, aggregator is unusable, thus I'd agree its a critical issue.

dawehner’s picture

+++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
@@ -163,9 +163,13 @@ public function build() {
       $rendered_items = array();
       foreach ($items as $item) {
+        if (!$item->getLink()) {
+          // No link, ignore it.

So $item->getLink() points to the external URL, right?
On the other hand, $item->urlInfo() points to an internal URL, ... this is a bit confusing. Does someone know, where my logic problem exists?

eclipsegc’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new1.56 KB

Frankly, the old code that was there didn't have this check, I think it's likely to be unnecessary. Let's try it without. (I'm guessing the check was introduced before the #href -> #url change was made or something)

Eclipse

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

@dawehner Item::buildUri() return the external URL. this happens to be the uri_callback of Item entity, which means urlInfo() for this entity will always be external

dawehner’s picture

@dawehner Item::buildUri() return the external URL. this happens to be the uri_callback of Item entity, which means urlInfo() for this entity will always be external

AAH, this is not obvious. Thank you!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed fe6ef2a and pushed to 8.0.x. Thanks!

This feels more like a major than a critical since it only affects an optional sub system - but not going to quibble at this point :)

  • alexpott committed fe6ef2a on 8.0.x
    Issue #2429501 by ParisLiakos, EclipseGc, mitrpaka: AggregatorFeedBlock...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.