Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
forum.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Apr 2013 at 21:27 UTC
Updated:
29 Jul 2014 at 22:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
larowlanComment #2
ParisLiakos commentedinject moduleHandler and call loadInclude:)
or..convert admin/structure/taxonomy/%taxonomy_vocabulary
first and then extends its class:)
Comment #3
larowlanPostponed on #1974492: Convert taxonomy_overview_terms to a Form Controller and therefore #1947432: Add a generic EntityAccessCheck to replace entity_page_access()
Comment #4
effulgentsia commentedComment #5
larowlanNote this also should port the local actions to use forum.local_action.yml
Comment #6
effulgentsia commentedBoth issues from #3 have landed.
Comment #7
effulgentsia commented#1: forum-overview.1.patch queued for re-testing.
Comment #9
disasm commentedJumpstarting this issue back up. Did a reroll, but noticed that things were so different, that wasn't going to do it, so attaching an interdiff with the changes from after the reroll. Changed the form to extend OverviewTerms. I'm getting the base form using parent::buildForm within the buildForm function.
Comment #11
disasm commentedRemoving forum.admin.inc (no longer exists) from hook_theme.
Comment #12
disasm commentedComment #14
jibranAll these patterns needs starting /.
I think we have to call parent::__construct here.
We can move the config array outside the loop.
Comment #15
disasm commentedFixed #1 and #3.
For #2, would need to pass all the dependencies needed by __construct, so makes more sense to set the dependencies here than call the parent. Added module_handler as a param to the constructor.
Comment #16
jibranThank you @disasm for fixing that. I think for 2
Theses attributes are not defined here so calling
parent::__construct($config_factory, $module_handler)will be enough. it seems more OO that __construct is calling its parent but anyways it is just my opinion.Comment #18
tim.plunkettYou should call parent:: here, or else you will introduce hard-to-find bugs later on if OverviewTerms is changed.
Comment #19
disasm commentedIn debugging these tests, most of the form array in buildForm was fairly different than the one being replaced in the callback. Whacked most of the form and redid the conversion. Also renamed to Overview since it's already in the Form namespace, no need to duplicate the name (The form it's extending does the same thing, OverviewTerms in taxonomy namespace).
constructor is also now calling parent.
Another bug was the way load() method was used to get the entity. It was passing an array, which loadMultiple expects, so switched it to just pass the vid. Enabled the module on my local, and the page is displaying now with no errors. I was able to get to both the new Forum, and new container forms. Lets see what testbot thinks!
Comment #21
disasm commentedfixes missing use flag
Comment #22
disasm commentedComment #24
disasm commentedThis patch adds the protected $entityManager variable to the Overview class. It also changes it and it's parent to store configFactory instead of individual config variables.
Comment #26
disasm commentedThis should fix remaining failures.
Comment #27
jibranentity.manager now.
Comment #29
disasm commentedfixing #27.
Comment #31
andypostTo fix the test you need to check taxonomy.local_actions.yml for proper route
As I remember Crell suggested to use config object if possible to make unit testing easy, because it's easy to pass then factory
Comment #32
disasm commented@andypost The test that's failing isn't a proper route issue, It's that the Add Forum button is showing up on the delete page. I'm not sure how this is even possible, because when the delete but is clicked, it sets the redirect to the correct path of the delete page, which should be independent of this form controller. Attached is a screenshot of the verbose output where the test is failing.
Comment #33
disasm commentedI converted the local actions to yml, but my local testing is still showing these on the delete form, although I'm not sure how.
Comment #35
larowlanThis needs a reroll now that we have dropped the forum-> container and cmi variable, will link to change notice once done, but basically forum-> forum_container-> value instead.
This is the last non hook procedural function in forum. Lets kill it and declare forum ready to ship!
Comment #36
larowlanChange notice is here https://drupal.org/node/2079767
Comment #37
larowlanComment #38
disasm commentedComment #39
disasm commentedMissed a reference to containers.
Comment #41
larowlanThis hunk is the cause of the fail
Comment #42
xjmThanks for your work on this issue! Please see #1971384-43: [META] Convert page callbacks to controllers for an update on the routing system conversion process.
Comment #43
larowlanLets' get this RTBC before the 14th.
Comment #45
disasm commented#43: forum-overview.43.patch queued for re-testing.
Comment #47
larowlanThe local tasks still rely on menu_get_item, ensuring we have a hook_menu entry for the delete pages means the action shouldn't show.
So removed the old alter.
Comment #49
larowlan#47: forum-overview.45.patch queued for re-testing.
Comment #50
jibranThis is ready to fly just minor things.
We have $urlGenerator in FormBase we can remove this and use it.
Can we add $argument array separately for readability?
Comment #51
larowlanFixes #50
Comment #52
jibranThanks for fixing it.
This should be
$this->getUrlGenerator(). Sorry for not being clear first time.Comment #54
larowlanFirst one changed, I think the second one is ok, value will be set by then.
Comment #55
jibranConsistence-- :D. It is ready to fly.
Comment #56
webchickThis is missing PHPDoc. Lee gave me the string 'Provides forum overview form for the forum vocabulary' in IRC ... fixed on commit.
That's unfortunate. :( Let's get a follow-up issue to add a config() method to FormBase, ok?
Committed and pushed to 8.x. Thanks!
Comment #57
larowlanFollow up is #2087279: Add a config() method to FormBase
Comment #58
webchickHm, shoot. I think this might've caused testbot failures.
Rolling back and re-testing.
Comment #59
webchick#54: forum-overview.53.patch queued for re-testing.
Comment #60
larowlanYeah saw the same fails in another issue
Comment #62
alexpottShould be using $this->urlGenerator() here on both lines - this is why head broke.
Should be \Drupal\forum\Form\Overview
Missing docblock
Comment #63
jibranFixed #62.
Comment #64
larowlanThanks jibran, assuming bot likes it
Comment #65
larowlan(phew) it was c4dd26c022c02532ee63ac2caf37c3f1b9c04628 that went in just before that broke it, knew I wasn't mad, getUrlGenerator() became urlGenerator().
Comment #66
webchickTrying that again. :)
Committed and pushed to 8.x. Thanks!