Problem/Motivation

#1957312: Use the entity storage controller in aggregator module converted getFeedDuplicates to entity query making it storage independent. #2403817: Feed entity validation misses form validation logic Removed usage

Proposed resolution

Remove it since its untested. Not only that, but it makes life harder for folks that write storage classes, cause it doesnt need to be there since it uses entity query

Remaining tasks

Commit

User interface changes

None.

API changes

getFeedDuplicates() is removed. (no change notice is needed because it has no D7 equilavent. the method was introduced in #2041083: Move database query out of \Drupal\aggregator\FeedFormController )

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue category Task because it does not affect any functionality
Prioritized changes Prioritized because it removes unused and untested code which reduces fragility.
Disruption Although an interface method is removed, the method was introduced recently within the 8.x dev cycle and i the usages in contrib/custom code should be really low.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

nice thought!
can we maybe name it just getDuplicates() then?

chx’s picture

FileSize
1.75 KB
4.38 KB
chx’s picture

Issue summary: View changes
ParisLiakos’s picture

I am sorry:/ i gave this a bit more thought:

Since this is only used in just one place and it is validation logic, it makes more sense to just move the whole entity query to the form.

I cant see this method being useful anywhere else outside this validation callback.

dawehner’s picture

I have to disagree with paris here. This is generic functionality, no matter how often core uses it.
On the other hand this also does not seem to make sense on the feed object. There seems to be room for a new service on which both getFeedIdsToRefresh and getFeedDuplicates exists.

chx’s picture

Two notes:

a) I am out of this issue. It bordered MongoDB work (I needed copypaste this method) so I did it but the moment it's controversial, I am out.

b) ItemStorage has no database in it at all either.

chx’s picture

Because plach asked what's the problem: well, the problem is that PHP is single inheritance and a class replacing the storage need to inherit from its own base class and then copy over these storage independent methods. In general, storage classes should contain the absolute minimum storage cos everything else will need to be copypasted.

marcingy’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 2: 2228733_2.patch, failed testing.

marcingy’s picture

Assigned: Unassigned » marcingy

I will look to reroll this not surprised it didn't pass!

marcingy’s picture

Status: Needs work » Needs review
FileSize
4.33 KB

Reroll and also killing dead use statements according too phpstorm that is anyway!

slashrsm’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

On the other hand this also does not seem to make sense on the feed object. There seems to be room for a new service on which both getFeedIdsToRefresh and getFeedDuplicates exists.

ItemStorage has no database in it at all either.

These two comments suggest that there might be a better place for this. And that we need to consider how to implement general functionality for storage classes.

dawehner’s picture

Status: Needs review » Needs work

More like needs work tbh.

ParisLiakos’s picture

#2403817: Feed entity validation misses form validation logic removed usage, so we can just remove it. its now unused and untested

ParisLiakos’s picture

Title: Move getFeedDuplicates to the Feed entity » Remove getFeedDuplicates - its unused and untested
Status: Needs work » Needs review
FileSize
1.57 KB

there

Status: Needs review » Needs work

The last submitted patch, 16: aggregator-feed_duplicates-2228733.patch, failed testing.

ParisLiakos’s picture

Status: Needs work » Needs review
FileSize
1.75 KB
805 bytes

lol, wrong method

chx’s picture

Status: Needs review » Reviewed & tested by the community

Let's hope the bot agrees.

ParisLiakos’s picture

Issue summary: View changes

thanks

ParisLiakos’s picture

Issue summary: View changes
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

This issue is a normal task so we need to outline how it fits within the allowable Drupal 8 beta criteria. Can someone add Drupal 8 beta phase evaluation template to the issue summary.

Removing unused and untested code reduces fragility so +1 to the change.

ParisLiakos’s picture

Assigned: marcingy » Unassigned
Issue summary: View changes
Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs issue summary update

added beta evaluation

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Less code - nice. Committed 5951f55 and pushed to 8.0.x. Thanks!

Thanks for adding the beta evaluation to the issue summary.

  • alexpott committed 5951f55 on 8.0.x
    Issue #2228733 by ParisLiakos, chx, marcingy: Remove getFeedDuplicates...

Status: Fixed » Closed (fixed)

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