- Issue created by @kalpanajaiswal
The OpenApiUi render element class in the OpenAPI UI module implements the ElementInterface, but does not provide implementations for all required methods. This leads to a fatal error when the element is invoked in Drupal 10.x:
Fatal error: Class Drupal\openapi_ui\Element\OpenApiUi contains 8 abstract methods and must therefore be declared abstract or implement the remaining methods (Drupal\Core\Render\Element\ElementInterface::initializeInternalStorage, Drupal\Core\Render\Element\ElementInterface::toRenderable, Drupal\Core\Render\Element\ElementInterface::getChildren, ...) in modules/contrib/openapi_ui/src/Element/OpenApiUi.php on line 59
This breaks pages using #type => 'openapi_ui' and makes the module incompatible with Drupal 10+ unless the class is updated.
#type => 'openapi_ui' element in a form or render array
Observe a fatal error due to missing method implementations in OpenApiUi.
ElementInterface in OpenApiUiRenderElementBase which already provides default implementations (preferred if targeting Drupal 10.3+)toRenderable() returns a render array by reference, as requiredActive
1.0
Code