Spin off from #2226063: Merge ListBooleanItem from options module into BooleanItem

The widgets provided by options.module are field-type agnostic and work with any field type that implements AllowedValuesInterface.

So they would be better off in Core, now that Core can provide plugins (wasn't the case back when we converted options.module to plugins). No need to depend on options.module if you just want the widgets.

That's kind of what we had in D7 - options.module was just providing agnostic widgets, and list.module was providing the field types. Then the two were merged because for some reason "list" was problematic for a module name in D8 (reserved keyword or something). But now we have Core for that :-)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yched’s picture

Issue summary: View changes
swentel’s picture

Status: Active » Needs review
FileSize
2.38 KB

Status: Needs review » Needs work

The last submitted patch, 2: 2302021-2.patch, failed testing.

swentel’s picture

Status: Needs work » Needs review
FileSize
2.51 KB
569 bytes

oh man

Status: Needs review » Needs work

The last submitted patch, 4: 2302021-4.patch, failed testing.

swentel’s picture

Status: Needs work » Needs review
FileSize
2.51 KB
yched’s picture

If we do that, we should be able to also remove dependencies on options.module in a couple core modules (like at least taxonomy ?), and also probably in a couple tests ?

Also, if we move the widget classes in a folder / namespace that alredy has 10+ widget files, we might want to make the class names a bit more specific (and connected to their base class) ?
Like OptionsWidgetBase / OptionsButtonsWidget / OptionsSelectWidget... ?

yched’s picture

Hm, "options" as a prefix is a bit pointless once those are out of options.module... Those are generic widgets for field types that implement AllowedValuesInterface, so maybe something like AllowedValuesWidgetBase etc... ?

swentel’s picture

Should the plugin id's then also be renamed, e.g. options_select -> select ?

yched’s picture

Heh, then again, #2329937: Allow definition objects to provide options renames AllowedValuesInterface to OptionsProviderInterface, so "options" would make sense again, It's then options.module, as the provider of List* field types, that is misnamed :-p

I'd vote for keeping Options / options_ as a prefix here (but adding it to the class names)

yched’s picture

fago’s picture

Status: Needs review » Needs work

Agreed that staying with options and having it as prefix is fine. It should move its tests also though.

fago’s picture

swentel’s picture

Status: Needs work » Needs review
Issue tags: +beta target
FileSize
2.77 KB

New patch, renamed the classes and removed the dependency of taxonomy on options.

yched’s picture

Status: Needs review » Reviewed & tested by the community

The namespace of the various classes is still Drupal\options\... :-p

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 14: 2302021-14.patch, failed testing.

yched’s picture

Status: Needs work » Needs review
FileSize
9.5 KB
8.17 KB

Fixed the namespaces, and removed a couple dependencies in tests (manually re-tested those to checks that the dependencies were actually not needed anymore)

And the RTBC in the previous comment was totally unintended :-p

swentel’s picture

Status: Needs review » Reviewed & tested by the community

Ahaha, silly me :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 17: 2302021_optionWidgets_Core-16.patch, failed testing.

undertext’s picture

Rerolled

undertext’s picture

Status: Needs work » Needs review
Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Check the diff of the two patches, only difference is ContentEntityInterface -> FieldableEntityInterface in one case.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 10cfcd6 and pushed to 8.0.x. Thanks!

  • alexpott committed 10cfcd6 on 8.0.x
    Issue #2302021 by swentel, yched, undertext: Move options.module widgets...

Status: Fixed » Closed (fixed)

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