Problem/Motivation

We do have a generic automatic views integration for entities, let's use it to safe some code.

Proposed resolution

Let AggregatorItemViewsData and AggregatorFeedViewsData extend EntityViewsData but ensure that the special integration is still in there.
Have a look at NodeViewsData for inspiration.

Remaining tasks

User interface changes

API changes

Comments

kgoel’s picture

Status: Active » Needs review
StatusFileSize
new11.01 KB

Status: Needs review » Needs work

The last submitted patch, 1: use-entityviewsdata-2355239-1.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new11 KB

Status: Needs review » Needs work

The last submitted patch, 3: use-entityviewsdata-2355239-3.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new11 KB

Fixed typo

Status: Needs review » Needs work

The last submitted patch, 5: use-entityviewsdata-2355239-5.patch, failed testing.

kgoel’s picture

Status: Needs work » Needs review
StatusFileSize
new10.99 KB

Fixed two silly mistake.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Its a great cleanup and reduction of the file size. Great work!

Fixed two silly mistake.

Feel free to also post the interdiffs over time.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 45e51b0 and pushed to 8.0.x. Thanks!

On commit I changed all t() to $this->t() here too - since we were touching every line.

diff --git a/core/modules/aggregator/src/AggregatorFeedViewsData.php b/core/modules/aggregator/src/AggregatorFeedViewsData.php
index e19b753..73a3871 100644
--- a/core/modules/aggregator/src/AggregatorFeedViewsData.php
+++ b/core/modules/aggregator/src/AggregatorFeedViewsData.php
@@ -28,28 +28,28 @@ public function getViewsData() {
       ),
     );
 
-    $data['aggregator_feed']['fid']['help'] = t('The unique ID of the aggregator feed.');
+    $data['aggregator_feed']['fid']['help'] = $this->t('The unique ID of the aggregator feed.');
     $data['aggregator_feed']['fid']['argument']['id'] = 'aggregator_fid';
     $data['aggregator_feed']['fid']['argument']['name field'] = 'title';
     $data['aggregator_feed']['fid']['argument']['numeric'] = TRUE;
 
     $data['aggregator_feed']['fid']['filter']['id'] = 'numeric';
 
-    $data['aggregator_feed']['title']['help'] = t('The title of the aggregator feed.');
+    $data['aggregator_feed']['title']['help'] = $this->t('The title of the aggregator feed.');
     $data['aggregator_feed']['title']['field']['id'] = 'aggregator_title_link';
     $data['aggregator_feed']['argument']['id'] = 'string';
 
-    $data['aggregator_feed']['url']['help'] = t('The fully-qualified URL of the feed.');
+    $data['aggregator_feed']['url']['help'] = $this->t('The fully-qualified URL of the feed.');
 
-    $data['aggregator_feed']['link']['help'] = t('The link to the source URL of the feed.');
+    $data['aggregator_feed']['link']['help'] = $this->t('The link to the source URL of the feed.');
 
-    $data['aggregator_feed']['checked']['help'] = t('The date the feed was last checked for new content.');
+    $data['aggregator_feed']['checked']['help'] = $this->t('The date the feed was last checked for new content.');
 
-    $data['aggregator_feed']['description']['help'] = t('The description of the aggregator feed.');
+    $data['aggregator_feed']['description']['help'] = $this->t('The description of the aggregator feed.');
     $data['aggregator_feed']['description']['field']['id'] = 'xss';
     $data['aggregator_feed']['description']['field']['click sortable'] = FALSE;
 
-    $data['aggregator_feed']['modified']['help'] = t('The date of the most recent new content on the feed.');
+    $data['aggregator_feed']['modified']['help'] = $this->t('The date of the most recent new content on the feed.');
 
     return $data;
   }
diff --git a/core/modules/aggregator/src/AggregatorItemViewsData.php b/core/modules/aggregator/src/AggregatorItemViewsData.php
index fb14787..8e40930 100644
--- a/core/modules/aggregator/src/AggregatorItemViewsData.php
+++ b/core/modules/aggregator/src/AggregatorItemViewsData.php
@@ -21,30 +21,30 @@ class AggregatorItemViewsData extends EntityViewsData implements EntityViewsData
   public function getViewsData() {
     $data = parent::getViewsData();
 
-    $data['aggregator_item']['table']['base']['help'] = t('Aggregator items are imported from external RSS and Atom news feeds.');
+    $data['aggregator_item']['table']['base']['help'] = $this->t('Aggregator items are imported from external RSS and Atom news feeds.');
 
 
-    $data['aggregator_item']['iid']['help'] = t('The unique ID of the aggregator item.');
+    $data['aggregator_item']['iid']['help'] = $this->t('The unique ID of the aggregator item.');
     $data['aggregator_item']['iid']['argument']['id'] = 'aggregator_iid';
     $data['aggregator_item']['iid']['argument']['name field'] = 'title';
     $data['aggregator_item']['iid']['argument']['numeric'] = TRUE;
 
-    $data['aggregator_item']['title']['help'] = t('The title of the aggregator item.');
+    $data['aggregator_item']['title']['help'] = $this->t('The title of the aggregator item.');
     $data['aggregator_item']['title']['field']['id'] = 'aggregator_title_link';
     $data['aggregator_item']['title']['field']['extra'] = 'link';
 
-    $data['aggregator_item']['link']['help'] = t('The link to the original source URL of the item.');
+    $data['aggregator_item']['link']['help'] = $this->t('The link to the original source URL of the item.');
 
-    $data['aggregator_item']['author']['help'] = t('The author of the original imported item.');
+    $data['aggregator_item']['author']['help'] = $this->t('The author of the original imported item.');
     $data['aggregator_item']['author']['field']['id'] = 'aggregator_xss';
 
-    $data['aggregator_item']['guid']['help'] = t('The guid of the original imported item.');
+    $data['aggregator_item']['guid']['help'] = $this->t('The guid of the original imported item.');
 
-    $data['aggregator_item']['description']['help'] = t('The actual content of the imported item.');
+    $data['aggregator_item']['description']['help'] = $this->t('The actual content of the imported item.');
     $data['aggregator_item']['description']['field']['id'] = 'aggregator_xss';
     $data['aggregator_item']['description']['field']['click sortable'] = FALSE;
 
-    $data['aggregator_item']['timestamp']['help'] = t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)');
+    $data['aggregator_item']['timestamp']['help'] = $this->t('The date the original feed item was posted. (With some feeds, this will be the date it was imported.)');
 
     return $data;
   }

  • alexpott committed 45e51b0 on 8.0.x
    Issue #2355239 by kgoel | dawehner: Let AggregatorItemViewsData and...

Status: Fixed » Closed (fixed)

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