Prior to 8.0.0-beta10, OptionsWidgetBase::getOptions() determined the presence of an "empty / no selection" option based on a hardcoded list of widget plugin IDs (the known core widgets extending that base class). Therefore, custom or contrib widgets extending OptionWidgetBase were not able to display an empty option without completely overriding OptionsWidgetBase::getOptions()
.
In 8.0.0-beta10, this hardcoded logic in OptionsWidgetBase::getOptions() has been replaced by a call to a new OptionsWidgetBase::getEmptyLabel() method, which provides a simpler override point for subclasses.
See OptionsWidgetBase::getEmptyLabel() for more details.
During the re-factoring of the code,
- the following constants have been removed :
OptionsWidgetBase::OPTIONS_EMPTY_NONE
OptionsWidgetBase::OPTIONS_EMPTY_SELECT
- OptionsWidgetBase::getEmptyOption()
was also removed, and replaced by getEmptyLabel()