Problem/Motivation
I'm working on tour_ui and right now, i'm forced to list manually all configuration attributes of plugin to be able to export them.
Information is already available in configuration protected attribute in TipPluginBase, so getting this data will help a lot.
Proposed resolution
Add getConfiguration() method to TipPluginBase so we can get all configuration attributes.
getConfiguration() method is part of ConfigurablePluginInterface, so TipPluginInterface should extends ConfigurablePluginInterface and PluginBase implement this the interface methods.
Comment | File | Size | Author |
---|---|---|---|
#19 | interdiff-2851166-16-19.txt | 1.08 KB | GoZ |
#19 | extends-2851166-19.patch | 3.06 KB | GoZ |
#16 | interdiff-2851166-13-16.txt | 1.22 KB | GoZ |
#16 | add_a-2851166-16.patch | 2.46 KB | GoZ |
#13 | interdiff-2851166-8-13.txt | 700 bytes | GoZ |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Centarro commentedComment #3
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedconfiguration protected attribute in TipPluginBase is now available in tip plugin interface.
Comment #4
xjmI can see how having this method available would be better DX. However, shouldn't it instead extend ConfigurablePluginInterface?
Comment #5
xjmComment #6
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedChecked documentation for ConfigurablePluginInterface , other modules such as search are also using this method.Similar should be the case with Tour.
Comment #7
GoZ CreditAttribution: GoZ at Centarro commentedI hesitated tout use this interface because that means we also have to implement setConfiguration() and defautConfiguration().
Comment #8
GoZ CreditAttribution: GoZ at Centarro commentedComment #9
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedNow it looks better.
Comment #10
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedNow it looks better.
Comment #11
alexpottI think this should be:
It's just a bit more future proof. And would cope with merging the attributes array if the defaults contained values.
Also the issue summary needs an update since making TipPluginInterface implement \Drupal\Component\Plugin\ConfigurablePluginInterface is a big change - and one that probably needs a CR and some thought about BC layers extra. Maybe Tour UI should extend TipPluginBase and do this itself?
Comment #12
GoZ CreditAttribution: GoZ at Centarro commentedOk with NestedArray::mergeDeep, i removed this and only use '+' to be make code simpler but it's ok for me to.
Unfortunately, Tour UI cannot do this itself. Right now, in case a custom tip does not provide getConfiguration(), we cannot save a tour.
Comment #13
GoZ CreditAttribution: GoZ at Centarro commentedComment #14
alexpott@GoZ okay - we need to update the issue summary and create change record for this. And it probably will not make it into 8.3.x since it is an API change.
Comment #15
tim.plunkettThis should be called from the constructor instead of just doing
$this->configuration = $configuration;
See https://www.drupal.org/node/2851635
This should be one line
This should be multiple lines :)
Comment #16
GoZ CreditAttribution: GoZ at Centarro commentedComment #17
GoZ CreditAttribution: GoZ at Centarro commentedChange record has been created https://www.drupal.org/node/2852401
Comment #19
GoZ CreditAttribution: GoZ at Centarro commentedFix configuration set in constructor and add defaultConfiguration() in TipPluginText to add own default configuration attributes.
I see thanks to last failed test that tour still have simpletest tests.
Comment #20
gaurav.kapoor CreditAttribution: gaurav.kapoor at OpenSense Labs commentedComment #21
xjmWe can use the new trait in #2852463: Create a trait and base class to implement \Drupal\Component\Plugin\ConfigurableInterface for this actually! Postponing briefly on that.
Comment #34
quietone CreditAttribution: quietone at PreviousNext commentedThis extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
Comment #35
smustgrave CreditAttribution: smustgrave at Mobomo commentedMoving over but blocking ticket #21 is still not complete after 7 years wonder if we can do something else in contrib.