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.
Convert this page callback to a new-style FormInterface implementation, using the instructions on http://drupal.org/node/1800686.
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedComment #2
mtiftI'll take this one.
Comment #3
mtiftHere's my first attempt.
Comment #5
mtiftFixed "route_name" typo
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedHi, thanks for picking this up!
Looks good so far, some notes:
lets call the route aggregator_opml_add so it is consistent with the rest routes there and also correctly prefixed
it should be _form and lets call the class OpmlAdd or OpmlFeedAdd so its inline with FeedItemsDelete )verb last)
this is being converted to guzzle on #1862524: Convert drupal_http_request usage in aggregator.module to Guzzle so when it is in (rtbc now) we can inject guzzle as well:)
opened #1963540: Move OPML parsing login in OpmlFeedAdd to a parser plugin for this, so we can inject this too, you can leave it as is for now:)
should get rid of db_query and use $this->database->query instead
Instead of using entity_create here, lets inject the entity manager and do what http://api.drupal.org/api/drupal/core!includes!entity.inc/function/entit... does:) get the storage and call create on it
indentation is off
Comment #8
mtiftThanks for the review, @rootatwc! The attached patch covers most of the comments in #7, except for the drupal_http_request() call.
Comment #10
ParisLiakos CreditAttribution: ParisLiakos commentedthe guzzle patch just committed so together with entity manager they should now be injected in the class
Not what i meant above.the plugin manager entity should be passed in the __construct with database, and should be stored in $this->entityManager..then no need to use drupal_container()
Comment #11
mtiftI got a bit confused with my re-roll, and ended up doing a straight
diff
rather than agit diff
. I also felt a little odd blowing away the changes from #1862524: Convert drupal_http_request usage in aggregator.module to Guzzle and putting them right back into this patch.Comment #12
ParisLiakos CreditAttribution: ParisLiakos commentedgreat! entity plugin manager is injected now:)
This should be injected as well, together with database and entity manager:)
it should be stored in $this->httpClient
Comment #14
twistor CreditAttribution: twistor commentedhmm...
#1963540: Move OPML parsing login in OpmlFeedAdd to a parser plugin would remove this entirely. Creating instead a different bundle with an OPML pipeline.
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedyeah but i am not really sure whether #1966070: Make aggregator feeds bundleable - move plugins configuration per bundle makes it in d8, so this is a really good step
Comment #16
mtiftSo like this?
Comment #18
ParisLiakos CreditAttribution: ParisLiakos commentedyes this looks great now, thanks
not sure why tests fail though, i should check manually once i find some time
Comment #19
ParisLiakos CreditAttribution: ParisLiakos commentedtests failed because _aggregator_parse_opml was in the admin.inc which was not loaded.
I moved it to a protected method to the controller with a todo above it.
Also injected the entityQuery and converted a query to use it instead:)
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commentedrerolled for conflict with multiple uploader patch, yay:)
Comment #21
ParisLiakos CreditAttribution: ParisLiakos commenteduhm, wrong patch above, does not contain the addition in file_save_upload in the Controller
Comment #22
larowlanThis looks good to me, waiting for the bot
Comment #23
larowlanI can't find anything wrong with #21 :)
Comment #24
ParisLiakos CreditAttribution: ParisLiakos commentedreroll for #1972262: Convert aggregator_feed_add to a new style controller
Comment #25
alexpottCommitted a1d4967 and pushed to 8.x. Thanks!