- Issue created by @mmarler
- Issue was unassigned.
This patch changes bootstrap_horizontal_tabs\Plugin\Field\FieldFormatter\BootstrapHorizontalTabs::viewElements so that it leaves $elements array empty if there is no data in field.
- Status changed to Needs review
over 1 year ago 10:49pm 26 May 2023 - last update
over 1 year ago 1 pass - Assigned to mark_fullmer
- πΊπΈUnited States mark_fullmer Tucson
This approach looks promising! Assigning myself for the review...
- Issue was unassigned.
- last update
over 1 year ago 1 pass - πΊπΈUnited States mark_fullmer Tucson
Okay, I agree with the proposal that the $elements array should be an empty array if there are no $items. This is the same design as in the core Link field, whose
viewElements
method starts by setting$element = [];
, and would effectively return the empty array if there are no items.The proposed implementation in #6, however, would still populate some of the
$elements
array, namely$elements['#tabs_wrapper_attributes'] = new Attribute($tabs_wrapper_attributes); $elements['#content_wrapper_attributes'] = new Attribute($content_wrapper_attributes);
While this wouldn't result in any PHP warnings or unexpected content, it seems better to return a truly empty array.
Due to additional logic we have in the code, we can't precisely follow the implementation of the Link module, but the attached patch effectively returns the same result if there are no items.
Unassigning myself so someone else can review.
- Assigned to bjc2265
- Status changed to RTBC
over 1 year ago 2:55pm 31 May 2023 -
mark_fullmer β
committed dfeba07f on 2.x
Issue #3362787 by bjc2265, mark_fullmer, mmarler: Multiple PHP warnings...
-
mark_fullmer β
committed dfeba07f on 2.x
- Status changed to Fixed
over 1 year ago 3:44pm 31 May 2023 Automatically closed - issue fixed for 2 weeks with no activity.