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.
Part of meta-issue #2016679: Expand Entity Type interfaces to provide methods, protect the properties.
See the detailed explanations there and look at the issues that already have patches or were commited.
Add get*, set* and additional methods as it makes sense to replace the public properties (e.g. isSomething() and something())
Comment | File | Size | Author |
---|---|---|---|
#42 | drupal8.aggregator-module.2028037-42.patch | 28.23 KB | LinL |
#40 | drupal8.aggregator-module.2028037-40.patch | 28.22 KB | LinL |
#38 | drupal8.aggregator-module.2028037-38.patch | 29.08 KB | LinL |
#34 | interdiff.txt | 6.96 KB | jsbalsera |
#34 | drupal8.aggregator-module.2028037-34.patch | 29.05 KB | jsbalsera |
Comments
Comment #1
marvin_B8 CreditAttribution: marvin_B8 commentedComment #2
marvin_B8 CreditAttribution: marvin_B8 commentedi add the get and set methods to the feedinteface.
Comment #4
marvin_B8 CreditAttribution: marvin_B8 commentedsecond try
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedHi, thanks for working on this
i dont think it makes sense to have this method. ID's are usually readonly:)
Comment #7
BerdirYes, see the instructions that I just posted to in #2016679-12: Expand Entity Type interfaces to provide methods, protect the properties.
Comment #8
marvin_B8 CreditAttribution: marvin_B8 commentedComment #9
marvin_B8 CreditAttribution: marvin_B8 commentedComment #11
BerdirAll setters should return \Drupal\aggregator\FeedInterface.
You can remove this method completely.
Too any empty lines here.
Comment #12
marvin_B8 CreditAttribution: marvin_B8 commentedComment #14
marvin_B8 CreditAttribution: marvin_B8 commentedComment #15
YesCT CreditAttribution: YesCT commentedwas that interdiff backward?
- 'href' => "admin/config/services/aggregator/edit/feed/{$feed->getId()}",
+ 'href' => "admin/config/services/aggregator/edit/feed/{$feed->fid}",
says you are using ->fid now, and not using getId().
is that right?
Comment #16
marvin_B8 CreditAttribution: marvin_B8 commentedwe don't use getId() anymore and yes i use ->fid because it is a return from a database query. i thought every $feed is a object but some of them a db querys and now i need to make some steps back with that patch. was a mistake from me.
Comment #17
tim.plunkettWhat you should do instead is inject the feed storage controller, and do
$feeds = $this->feedStorage->loadMultiple($result);
And then loop over them using the proper methods (id() not getId()).
Comment #18
marvin_B8 CreditAttribution: marvin_B8 commentedi need some help because i'm not sure how i can change the feed db querys in
-AggregatorFeedBlock.php
-ImportOpmlTest.php
-Aggregator.pages.php
or i don't need it ?
Comment #19
marvin_B8 CreditAttribution: marvin_B8 commenteddoppel post sry
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commentedi can take a look sometime this week, but till then you could check the patch in #1957312: Use the entity storage controller in aggregator module it might help
Comment #21
BerdirYes, not sure about changing this, missing some parts like ->items (which is a count()). I'd just leave this for now.
This is not necessary.
Yeah, we didn't this for other interfaces. language() unfortunately returns the language entity but that's fine.
This one is useful, so keep that.
Should only have a single empty line above @param.
Let's document that it's in seconds.
getRefreshRate()? Method names should be a good compromise between self-explaining and not too long :)
Two spaces in front of the text. let's reove the as unix timestamp from here, to keep it under 80 characters. We still have that in the @return.
Let's name this (get/set)LastCheckedTime(), that's also used as variable for the feed source template.
Again two empty lines.
Let's also try to find a better method name for this... getQuuedTime()?
No need to repeat in, just timestamp of the last refresh should be enough.
What about getWebsiteLink() then?
the @return is copied from somewhere.
Not sure what to name this one.
This could use a little bit more documentation, the @return also isn't really a sentence.
getLastModified() I'd say.
Tricky one. getBlockItemCount()? Sad that this is still in here, wanted to move it to instance configuration· Too late now I guess.
Comment #22
jsbalseraComment #23
jsbalseraRe-rolled and changes made, except changing getLink with getWebsiteLink, because it causes the test to fail, and generating the next Uncaught Exception:
Uncaught PHP Exception Zend\\Feed\\Reader\\Exception\\BadMethodCallException: "Method: getWebsiteLinkdoes not exist and could not be located on a registered Extension" at /home/jsanchez/projects/d8/core/vendor/zendframework/zend-feed/Zend/Feed/Reader/Feed/AbstractFeed.php line 259
Comment #24
jsbalseraComment #25
BerdirThanks, I think we're getting close here :)
I don't think there is a need for an explicit is_null() check, just if (!$feed->getLink()) should be fine. The empty was when those objects weren't typed and might or might not have those properties.
Same here.
This seems like an accidental revert, those changes should be removed from the patch.
The class has been renamed, so this will conflict here, just re-remove it.
lowercase, also not sure if we should use "language code".
Should be URL I think (only in the docblock, the method name has to be camel case.
Over 80 characters. Maybe remove the as unix timestamp part, as we have that in the @return anyway.
Time here and in the other docbocks below should be lowercase.
Comment #26
johnennew CreditAttribution: johnennew commentedGoing to pick this one up now.
Comment #27
johnennew CreditAttribution: johnennew commentedI took getLangcode() and setLangcode() out of the FeedInterface as they don't appear to be used anywhere. Can put these back if they are needed.
Added corrections from #25 above.
Renamed *etLink() to *etWebsiteLink() as suggested - not sure what the error in #23 is, I didn't get it.
Couldn't make an interdiff
Comment #28
johnennew CreditAttribution: johnennew commentedSome whitespace in the last patch has been removed.
Comment #29
Berdir#28: drupal8.aggregator-module.2028037-28.patch queued for re-testing.
Comment #31
jsbalseraRerolled patch
Comment #32
ParisLiakos CreditAttribution: ParisLiakos commentedwe should remove those. feeds no longer have a block property
I would say name this (get|set)WebsiteUrl().
"link" makes me think o
<a>
tags, while this here, will only give you the href ;)we should either prefix both with Last or none;)
Comment #33
ParisLiakos CreditAttribution: ParisLiakos commentedComment #34
jsbalseraComment #35
BerdirI think this is good to go.
Comment #36
Xano34: drupal8.aggregator-module.2028037-34.patch queued for re-testing.
Comment #37
Xano34: drupal8.aggregator-module.2028037-34.patch queued for re-testing.
Comment #38
LinL CreditAttribution: LinL commentedRerolled, patch no longer applied.
Comment #39
ParisLiakos CreditAttribution: ParisLiakos commentedComment #40
LinL CreditAttribution: LinL commentedRerolled without
core/modules/aggregator/lib/Drupal/aggregator/Tests/CategorizeFeedTest.php
deleted in #2127725: Remove category handling from aggregatorComment #41
ParisLiakos CreditAttribution: ParisLiakos commentedthank you!
Comment #42
LinL CreditAttribution: LinL commentedAnd another reroll.
Comment #43
LinL CreditAttribution: LinL commentedComment #44
ParisLiakos CreditAttribution: ParisLiakos commentedComment #45
xjm42: drupal8.aggregator-module.2028037-42.patch queued for re-testing.
Comment #46
Berdir42: drupal8.aggregator-module.2028037-42.patch queued for re-testing.
Comment #47
xjmComment #48
webchickI just committed #2149841: The 'aggregator_feed' entity type doesn't have a UUID field which probably means this one needs a re-roll.
This initiative was totally off my radar and I do not understand why we are doing this (the linked issue summary just says "->getSomething() would be nicer" which strikes me as a spurious reason to spear-head such a massive API change as this post-API freeze), but I guess Alex Pott has been committing these for the most part, so I'll probably leave it to him.
Comment #49
YesCT CreditAttribution: YesCT commentedThe patch still applies.
I'll send it for a retest.
I took a look at #2149841: The 'aggregator_feed' entity type doesn't have a UUID field
and given that @Berdir says in #2016679-12: Expand Entity Type interfaces to provide methods, protect the properties not to add uuid() or setUuid()
I'm not sure what needs work here.
These might be of interest:
ag "function uuid\\(" core
ag "function getUuid\\(" core
Comment #50
YesCT CreditAttribution: YesCT commented42: drupal8.aggregator-module.2028037-42.patch queued for re-testing.
Comment #51
BerdirAgreed that there is probably no overlap, there is already a uuid() method provided by Entityinterface.
Comment #52
ParisLiakos CreditAttribution: ParisLiakos commentedback to rtbc then
Comment #53
webchickOk, since we made the decision in the other issue to do this method-ification to all the things, let's do this.
Committed and pushed to 8.x.
We'll need to scour existing change notices to make sure they reflect the methods introduced here.
Comment #54
xjmI believe this is covered by https://drupal.org/node/1806650, so added that to this issue. I only found one other reference to FeedInterface in the change records and it was fine.
Comment #55
xjm