- Issue created by @raileanu.nalexandru
- Status changed to Closed: won't fix
11 months ago 2:56pm 8 January 2024
Some plugins incorrectly extend the SchemaNameBase "form()" function definition, by not declaring the "array" return type:
Fatal error: Declaration of Drupal\schema_recipe\Plugin\metatag\Tag\SchemaRecipeRecipeIngredient::form(array $element = []) must be compatible with Drupal\schema_metatag\Plugin\metatag\Tag\SchemaNameBase::form(array $element = []): array in /var/www/html/docroot/modules/contrib/schema_metatag/schema_recipe/src/Plugin/metatag/Tag/SchemaRecipeRecipeIngredient.php on line 34
On a new/clean project:
Add the module to a project, enable and configure the recipe related schema - fatal error due to "recipeInstructions" and "recipeIngredient" fields plugin definition.
Update the "form()" function definition by adding the return type:
public function form(array $element = []) {
to
public function form(array $element = []): array {
Closed: won't fix
3.0
Code