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.
Right now, only processors can expose configuration from the plugins..if you need to provide configuration for a parser or fetcher you have to hoook_form_alter
We should make the API consistent and provide this ability for parsers and fetchers as well
Postponed on
#1925048: Convert aggregator's system_config_form() to SystemConfigFormBase
Comment | File | Size | Author |
---|---|---|---|
#84 | drupal-aggregator_plugins_settings-1957330-84.patch | 37.22 KB | ParisLiakos |
#84 | interdiff.txt | 8.07 KB | ParisLiakos |
#82 | drupal-aggregator_plugins_settings-1957330-82.patch | 31.82 KB | ParisLiakos |
#78 | drupal-aggregator_plugins_settings-1957330-78.patch | 31.81 KB | ParisLiakos |
#78 | interdiff.txt | 1.52 KB | ParisLiakos |
Comments
Comment #1
andypostWhy this postponed?
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedBecause they touch the same code and the other patch is ready.no point starting this one and then reroll it..you think we should re-postpone the other issue?
Comment #3
andypostWhile there's no code no collisions. Also I see no dependency between
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedhaving a go at this we definitely need this cleanup soon
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedwhat about this?
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commentedrelated #1764380: Merge PluginSettingsInterface into ConfigurableInterface
Comment #7
ParisLiakos CreditAttribution: ParisLiakos commentedAdded validate..i thought extending FormInterface, but it has getFormId() :/
Comment #8
tim.plunkettThis should definitely use FormInterface. What's wrong with getFormID()?
Comment #9
ParisLiakos CreditAttribution: ParisLiakos commentedand we have to actually call it:)
Comment #10
ParisLiakos CreditAttribution: ParisLiakos commented@timplunkett you are right..i thought about this in a completely different way
patch coming
Comment #11
ParisLiakos CreditAttribution: ParisLiakos commentedhere is it..
i am not sure if extending fetcher, parser processor interfaces with formInterface is ok, i just want to save checking if the plugin has this method in admin form..right now we are sure that a plugin has those methods..but maybe i should not extend them and just check in admin form whether the plugin extends FormInterface before calling the method?
Comment #12
tim.plunkettThe title of this issue implies that exposing configuration should be possible, but not required, I would say checking
if ($parser instanceof FormInterface) { $form = drupal_get_form($parser); }
is your best bet.Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedagreed..also think its better for DX..if you want your plugin to expose settings extend
AggregatorPluginSettingsBase
Comment #14
twistor CreditAttribution: twistor commentedThe patch looks pretty good. I haven't done a fine-grained pass on it yet.
rootatwc and I discussed this on IRC. I had mentioned that we might like to separate the form classes from the plugins. Now I'm thinking that's probably a good idea for 2 reasons.
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedHere is a unit test..it contains patch from
#1974266: Register test module classes to PHPunit
i also moved aggregator_test modules in a modules folder
Comment #16
larowlan+1 to this change
Comment #17
ParisLiakos CreditAttribution: ParisLiakos commentedYeah, had to change the references to the files that moved..also i missed the @ from inheritdocs:P
Comment #18
twistor CreditAttribution: twistor commented*instantiated
Asterisk is off.
Missing new line.
Should be using $this->configFactory.
Should we inject the Database and Entity manager/storage controller?
$this->configFactory
Awesome!
Comment #19
ParisLiakos CreditAttribution: ParisLiakos commentedthanks for the review and nice catches!
Let's leave this for #1957312: Use the entity storage controller in aggregator module
Comment #20
andypostnot sure it's fine to have empty implementations
Comment #21
ParisLiakos CreditAttribution: ParisLiakos commentedi dont think an empty method in an abstract class is something bad.
\Drupal\system\SystemConfigFormBase::validateForm()
does the samethat way, classes extending dont have to declare a validate method. not all forms needs validation
Comment #22
twistor CreditAttribution: twistor commentedIt's a matter of having possibly several empty methods vs. one. It's a pretty common pattern, not sure about core.
Comment #23
tim.plunkettHaving an empty validate is fine, but there is no point of a form without a submit, that shouldn't be in the base class so subclasses are forced to implement
Comment #24
ParisLiakos CreditAttribution: ParisLiakos commentedAgreed. But then this is the same for buildForm()..so i ll roll a patch later that removes those two methods
Comment #25
ParisLiakos CreditAttribution: ParisLiakos commentedComment #26
ParisLiakos CreditAttribution: ParisLiakos commentedforgot interdiff:/
Comment #27
ParisLiakos CreditAttribution: ParisLiakos commented#1974266: Register test module classes to PHPunit went in, this should be good to go
rerolling
Comment #28
ParisLiakos CreditAttribution: ParisLiakos commentedno longer applies, manually edited
Comment #29
ParisLiakos CreditAttribution: ParisLiakos commentedComment #30
ParisLiakos CreditAttribution: ParisLiakos commentedsigh
Comment #31
ParisLiakos CreditAttribution: ParisLiakos commentedone more fail...
Comment #33
ParisLiakos CreditAttribution: ParisLiakos commentedreroll
Comment #34
ParisLiakos CreditAttribution: ParisLiakos commentedComment #36
ParisLiakos CreditAttribution: ParisLiakos commentedi totally messed up the reroll:)
Comment #37
ParisLiakos CreditAttribution: ParisLiakos commentedpostponing for #2018411: Figure out a nice DX when working with injected translation
please review/rtbc there
Comment #38
ParisLiakos CreditAttribution: ParisLiakos commentedComment #39
ParisLiakos CreditAttribution: ParisLiakos commentedtest module was moved in another issue.
AggregatorPluginManager now extends the shiny new DefaultPluginManager..
lets get this in, since it is an API change. i will fix the translations things after the DX issue is in
Comment #40
andypostPatch looks great! except:
WTF?
Comment #41
ParisLiakos CreditAttribution: ParisLiakos commentedheh, drupal_set_title kills the phpunit test, so i cant actually test submit form method..i used to have it in a comment, but then inspired from a views_ui test so i guessed its ok...we buy one more test, for some ugliness in a test class. i would rather have the test
Comment #42
BerdirRemoving drupal_set_title() is AFAIK still a release-blocking critical to actually get the benefits of all the new stuff we put into core. Maybe add a @todo and say remove when we fix issue X (X being the critical where this is being talked about). I think that would help to actually remove it when doing so.
Comment #43
ParisLiakos CreditAttribution: ParisLiakos commentedyou are right, a link always help!
Comment #44
andypostLooks like ready to go! @twistor RTBC?
Comment #45
twistor CreditAttribution: twistor commentedSo close!
$this->translation needs to be defined as a property.
Should we call alterInfo() here?
Comment #46
ParisLiakos CreditAttribution: ParisLiakos commentedWell there was not an alter hook before, i guess we would need some documentation if we add it?
i fix the property
Comment #47
andypostAltering could be added as api-addition after july 1
Comment #48
alexpottDoing this just to phpunit test functionality is not right... now if anything changes in the parent::buildForm() then we need to remember to change it here... if we want to test this with phpUnit we have to postpone on #2018411: Figure out a nice DX when working with injected translation
Wrong link this is for drupal_set_title :)
Comment #49
tstoecklerSome tests currently just define a
at the top of their test to avoid that problem. Don't know if we want to do that here...
Comment #50
BerdirYes, that works fine for constants, but for functions, you get into trouble due to namespaces, and need to do ugly things with multiple namespaces in the same file.
Comment #51
ParisLiakos CreditAttribution: ParisLiakos commentedActually its a nice idea, lets do that, at least we wont have to hack out the parent call
Comment #52
andypostAwesome!
Comment #53
alexpottNeeds a reroll
Comment #54
ParisLiakos CreditAttribution: ParisLiakos commentedconflicted with
/aggregator/categories
routing conversionComment #55
ParisLiakos CreditAttribution: ParisLiakos commentedback to rtbc
Comment #56
YesCT CreditAttribution: YesCT commentedThis issue was RTBC and passing tests on July 1, the beginning of API freeze.
Comment #57
alexpottWe should typehint to the interface considering we have one.
Comment #58
ParisLiakos CreditAttribution: ParisLiakos commentedgood point
Comment #59
tim.plunkettShouldn't you key the instances so we don't have dupes? Though the three plugin types could have clashes.
Maybe rename $this->instances to indicate these are ones that implement FormInterface...
This just feels like an abuse of FormInterface, actually.
In every other case we don't reuse the interface, we just have another interface like \Drupal\Core\Action\ConfigurableActionInterface, until #2006248: Add an EmbeddableFormInterface so that FormInterface can delegate to multiple objects is resolved...
Comment #60
tim.plunkettActually the interfaces added in #2033383: Provide a default plugin bag are very relevant here:
PluginFormInterface
ConfigurablePluginInterface
Comment #61
ParisLiakos CreditAttribution: ParisLiakos commentednot much time, unassigning in case someone wants to work on it
Comment #62
twistor CreditAttribution: twistor commentedI'll take a stab at this.
Comment #63
twistor CreditAttribution: twistor commentedStill needs some work, want to see what the testbot says.
Comment #65
twistor CreditAttribution: twistor commentedBah
Comment #67
twistor CreditAttribution: twistor commentedNot sure about the changes to AggregatorPluginSettingsBaseTest still wrapping my head around that stuff.
Comment #69
twistor CreditAttribution: twistor commented#67: drupal-aggregator_plugins_settings-1957330-67.patch queued for re-testing.
Comment #71
ParisLiakos CreditAttribution: ParisLiakos commentedthanks @twistor for working on this!
i rerolled it, no longer applies, and fixed the phpunit test
Comment #72
ParisLiakos CreditAttribution: ParisLiakos commentedso, lets make use of ConfigurablePluginInterface too
Comment #73
ParisLiakos CreditAttribution: ParisLiakos commentednot sure how this jumped in
Comment #74
tim.plunkettThis patch looks awesome! Only minor things, it's essentially RTBC
Any benefit to keying this by $id?
Can these be split onto multiple lines please?
Since this is the first implementation of ConfigurablePluginInterface and PluginFormInterface to not be managed by a PluginBag/ConfigEntity, this is a little weird to call this here. Let's add an @todo in case we ever refactor for ConfigEntity.
Comment #75
ParisLiakos CreditAttribution: ParisLiakos commentedthanks for the review:)
this patch takes care of the points above
Comment #76
tim.plunkettHere and elsewhere, s/id/ID.
Also, #1847002: Move entity type classes from Drupal\$provider\Plugin\Core\Entity to Drupal\$provider\Entity went in, which will break the patch.
Comment #78
ParisLiakos CreditAttribution: ParisLiakos commentedfixed ID and rerolled
Comment #79
ParisLiakos CreditAttribution: ParisLiakos commentedComment #80
tim.plunkettThanks, looks RTBC (again) to me!
Comment #81
alexpottNeeds a reroll
Comment #82
ParisLiakos CreditAttribution: ParisLiakos commentedsome use statements conflict with FormBase patch
Comment #84
ParisLiakos CreditAttribution: ParisLiakos commentedYay for FormBase
Comment #85
jibranAnd back to RTBC as per #80.
Comment #86
alexpottCommitted bc602a7 and pushed to 8.x. Thanks!
Comment #87
ParisLiakos CreditAttribution: ParisLiakos commentedthanks everyone helping me out with this issue!
change notice is here https://drupal.org/node/2078169
Cheers
Comment #89
xjmThis one we blame on d.o.