Postponed (maintainer needs more info)
Project:
XML sitemap
Version:
8.x-1.x-dev
Component:
xmlsitemap.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Mar 2020 at 16:02 UTC
Updated:
10 Jun 2020 at 03:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
thallesFollow a patch
Comment #3
dave reidConfigFormBase isn't just any old class though, it's intended use it to be extended. Is there an issue where this is being discussed or fixed in core?
Comment #4
dave reidThe other issue with doing this is when plugin base classes have logic inside their __construct() methods, such as calling setConfiguration(). If in our own plugin's defaultConfiguration() method we rely on an additional service, then it will be undefined when the parent's constructor is called.
Comment #5
thallesThe documentation class apparently asked to the denpendency injection will be make this:
Drupal\Core\Form\FormBase
Comment #6
thallesComment #7
ilgnerfagundes commentedThe patch was applied correctly, and the form is working perfectly.
Comment #8
neclimdulYeah, I'm not buying that. Is there some core discussion around this I missed? This is just silly and dead wrong.
Comment #9
thalleshttps://events.drupal.org/seattle2019/sessions/drupal-9-coming-getting-y...
https://youtu.be/hN9KjaBvAUk?t=1443
Comment #10
neclimdulI saw those in your summary but a talk at Drupalcon isn't a framework decision. While valid this is _not_ how the API was designed to be used. I'll talk to Alex I guess.
Comment #11
thallesIs this FormBase documentation not valid?
Comment #12
neclimdulI strongly believe it is wrong yes. Or at the least very misleading.
The misleading part is "less structured use of traits" and
StringTranslationTrait::setStringTranslation. It is not obvious that saying to populate the trait dependency(which doesn't have a constructor because its a trait) and not bypassing injecting dependencies into the constructor. Should that also be in the constructor? Maybe. Its a lot different form moving all constructor logic into the create method though.I had a pretty long discussion on slack last night and this morning with some core developers and I'm not sure there was a consensus in anything other than "inheritance got us to this mess and is generally pretty terrible". I'll open the core issue to resolve/clarify the documentation on form base. We can capture and continue the discussion there.
Comment #13
thallesOk!
When you create, shared the link here, please!
Comment #14
dave reid@neclimdul: Any chance you have filed that core issue?