Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
aggregator.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
31 Mar 2013 at 08:35 UTC
Updated:
29 Jul 2014 at 22:06 UTC
Jump to comment: Most recent file
Comments
Comment #1
andypostWhy this postponed?
Comment #2
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 commentedhaving a go at this we definitely need this cleanup soon
Comment #5
ParisLiakos commentedwhat about this?
Comment #6
ParisLiakos commentedrelated #1764380: Merge PluginSettingsInterface into ConfigurableInterface
Comment #7
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 commentedand we have to actually call it:)
Comment #10
ParisLiakos commented@timplunkett you are right..i thought about this in a completely different way
patch coming
Comment #11
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 commentedagreed..also think its better for DX..if you want your plugin to expose settings extend
AggregatorPluginSettingsBaseComment #14
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 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 commentedYeah, had to change the references to the files that moved..also i missed the @ from inheritdocs:P
Comment #18
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 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 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 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 commentedAgreed. But then this is the same for buildForm()..so i ll roll a patch later that removes those two methods
Comment #25
ParisLiakos commentedComment #26
ParisLiakos commentedforgot interdiff:/
Comment #27
ParisLiakos commented#1974266: Register test module classes to PHPunit went in, this should be good to go
rerolling
Comment #28
ParisLiakos commentedno longer applies, manually edited
Comment #29
ParisLiakos commentedComment #30
ParisLiakos commentedsigh
Comment #31
ParisLiakos commentedone more fail...
Comment #33
ParisLiakos commentedreroll
Comment #34
ParisLiakos commentedComment #36
ParisLiakos commentedi totally messed up the reroll:)
Comment #37
ParisLiakos commentedpostponing for #2018411: Figure out a nice DX when working with injected translation
please review/rtbc there
Comment #38
ParisLiakos commentedComment #39
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 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 commentedyou are right, a link always help!
Comment #44
andypostLooks like ready to go! @twistor RTBC?
Comment #45
twistor commentedSo close!
$this->translation needs to be defined as a property.
Should we call alterInfo() here?
Comment #46
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 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 commentedconflicted with
/aggregator/categoriesrouting conversionComment #55
ParisLiakos commentedback to rtbc
Comment #56
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 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 commentednot much time, unassigning in case someone wants to work on it
Comment #62
twistor commentedI'll take a stab at this.
Comment #63
twistor commentedStill needs some work, want to see what the testbot says.
Comment #65
twistor commentedBah
Comment #67
twistor commentedNot sure about the changes to AggregatorPluginSettingsBaseTest still wrapping my head around that stuff.
Comment #69
twistor commented#67: drupal-aggregator_plugins_settings-1957330-67.patch queued for re-testing.
Comment #71
ParisLiakos commentedthanks @twistor for working on this!
i rerolled it, no longer applies, and fixed the phpunit test
Comment #72
ParisLiakos commentedso, lets make use of ConfigurablePluginInterface too
Comment #73
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 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 commentedfixed ID and rerolled
Comment #79
ParisLiakos commentedComment #80
tim.plunkettThanks, looks RTBC (again) to me!
Comment #81
alexpottNeeds a reroll
Comment #82
ParisLiakos commentedsome use statements conflict with FormBase patch
Comment #84
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 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.