Its id is datatime_extras_configurable_list

While that obviously works, I suspect it was supposed to be datetime_extras_configurable_list (a->e in the first word "date")

Not really non-disruptive to change, but here is a patch for starters :)

Comments

eiriksm created an issue. See original summary.

eiriksm’s picture

Status: Active » Needs review
StatusFileSize
new669 bytes
heddn’s picture

Status: Needs review » Needs work

We need a BC layer for this. Can we add a "LegacyDateTimeDatelistWidget" that still retains the old name. Then add a trigger_error? Similar to https://www.drupal.org/core/deprecation#how-method

That way folks who are using the old one in their config will get notified of the deprecation and can update to the new widget.

dww’s picture

Title: Configurable list widget has a typo in its id » [PP-1] Configurable list widget has a typo in its id
Status: Needs work » Postponed
Parent issue: » #3026314: Standardize naming conventions for plugins, config IDs, classes, etc

As we rename this, let's make sure we only have to do it once. ;)

dww’s picture

If we agree @ #3026314: Standardize naming conventions for plugins, config IDs, classes, etc, then this widget should use:

id: datetime_configurable_list
class: DateTimeConfigurableListWidget

Obviously the legacy one needs the old ID. Maybe the classname should include "Deprecated" in the name? "Legacy" is perhaps not clear enough. Something like this?

id: datatime_extras_configurable_list
class: DeprecatedDateTimeConfigurableListWidget

Also, the recommended way to deprecate a plugin is here:

https://www.drupal.org/core/deprecation#how-plugin (#how-plugin not #how-method)

This recommends: "Add @trigger_error('...', E_USER_DEPRECATED) to the plugin constructor." and also suggests "no_ui = true" in the annotation.

Cheers,
-Derek

dww’s picture

Title: [PP-1] Configurable list widget has a typo in its id » Configurable list widget has a typo in its id
Assigned: Unassigned » heddn
Status: Postponed » Active

#3026314: Standardize naming conventions for plugins, config IDs, classes, etc is now in. We have a clear standard we can now follow.

@heddn: would you be willing to take care of this one? It was your typo in the first place. ;)

Thanks!
-Derek

heddn’s picture

I'll work on this.

heddn’s picture

Assigned: heddn » Unassigned
Status: Active » Needs review
StatusFileSize
new10.08 KB

So, following our mantra for tests, here's one that does some minimal BC testing.

Status: Needs review » Needs work

The last submitted patch, 8: 2973035-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new2.09 KB
new10.08 KB

Status: Needs review » Needs work

The last submitted patch, 10: 2973035-10.patch, failed testing. View results

heddn’s picture

Status: Needs work » Needs review

Not sure what's going here. Build passed, no phpcs failures. Is this the testbots?

dww’s picture

Status: Needs review » Needs work

Excellent, thanks! Almost there.

The new class name doesn't match what we say it should be in CONTRIBUTING.md:

```datetime_configurable_list``` => ```DateTimeConfigurableListWidget```

Other nits/questions:

  1. +++ b/src/Plugin/Field/FieldWidget/DateConfigurableListWidget.php
    @@ -16,92 +14,16 @@ use Drupal\datetime\Plugin\Field\FieldWidget\DateTimeDatelistWidget;
    +    @trigger_error('The ' . __NAMESPACE__ . '\DateConfigurableListWidget is deprecated in 1.x and will be removed before 2.0. Instead, use ' . __NAMESPACE__ . '\DateTimeConfigurableList.', E_USER_DEPRECATED);
    

    New class name should change. But for this, shouldn't we say "8.x-1.x and will be removed before 8.x-2.0"? "1.x" and "2.0" aren't meaningful contrib version strings (yet).

  2. +++ b/src/Plugin/Field/FieldWidget/DateTimeConfigurableList.php
    @@ -0,0 +1,107 @@
    + *   label = @Translation("Configurable list"),
    

    Probably out of scope, but since we're already moving this around, I wonder if we could come up with a better label for this widget. ;) I'm still not totally sure what it does and why it's here.

    While you're at it, can you add a short section to README.md about this widget, too?

  3. +++ b/src/Plugin/Field/FieldWidget/DateTimeConfigurableList.php
    @@ -0,0 +1,107 @@
    +class DateTimeConfigurableList extends DateTimeDatelistWidget {
    

    Per our conventions, this new class should be "DateTimeConfigurableListWidget" (with the "Widget" on the end). The plugin ID doesn't need it, but the class does.

  4. +++ b/tests/src/Kernel/DateTimeConfigurableListTest.php
    @@ -0,0 +1,61 @@
    +    'text',
    

    Curious: why do we need this?

  5. +++ b/tests/src/Kernel/DateTimeConfigurableListTest.php
    @@ -0,0 +1,61 @@
    +    // Set default storage backend and configure the theme system.
    

    Stale comment? The code doesn't look like it has anything to do with storage backends nor the theme system.

Thanks again!
-Derek

p.s. x-post with your testbot woes. No immediate insights. I'll see if I can dig in later.

dww’s picture

p.p.s. Re-queued #10 for a few more testing configs, including PHP 7.2 and 8.6.x. Let's see if that makes any difference. I'm following a thread in #drupal-infrastructure in Slack on a related topic right now. Trying to gather more data points for that.

dww’s picture

Okay, yeah, word on the street is that we've got more than 2^32 entries in a table in PIFT and the testbot is blowing up. They're trying to alter this table in the DB. It's going to Take Awhile(tm). ;) Fun. So yeah, don't worry about re-queuing this or relying on d.o testbot results for now.

But, you're welcome to fix the concerns in #13 if you're feeling inspired. ;)

Cheers,
-Derek

dww’s picture

Bot recovered. Once we address #13, a new patch should test just fine.

Thanks,
-Derek

heddn’s picture

Status: Needs work » Needs review
StatusFileSize
new6.79 KB
new10.89 KB

13.1: I think in terms of composer version strings. In those terms it is 1.x and 2.0. We also have precident in other contrib projects that use this type of versioning. See https://cgit.drupalcode.org/address/tree/src/Plugin/migrate/cckfield/Add... as an example.

The rest of the feedback in 13 is now addressed.

dww’s picture

+++ b/src/Plugin/Field/FieldWidget/DateConfigurableListWidget.php
@@ -2,106 +2,31 @@
+ * \Drupal\datetime_extras\Plugin\Field\FieldWidget\DateTimeConfigurableListWidget

This comment needs to match your new class name.

Otherwise, looks RTBC to me. Feel free to commit if you're happy with the new names for this. Maybe @mpdonadio wants to weigh in?

Thanks!
-Derek

  • heddn committed 1cd3d42 on 8.x-1.x
    Issue #2973035 by heddn, eiriksm, dww: Configurable list widget has a...
heddn’s picture

Status: Needs review » Fixed
dww’s picture

Thanks!

  • dww committed 8435208 on 8.x-1.x
    Issue #2973035 by dww: Followup to fix examples in CONTRIBUTING.md to...
dww’s picture

Pushed a commit for a tiny follow-up to remove stale references to "datetime_configurable_list" from CONTRIBUTING.md. ;)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.