Missing 'config_export' definition in annotation

Created on 12 April 2022, about 2 years ago
Updated 15 February 2023, over 1 year ago

Problem/Motivation

After saving a menu item, the following error is returned.

Drupal\Core\Config\Schema\SchemaIncompleteException: Entity type 'Drupal\menu_link_config\Entity\MenuLinkConfig' is missing 'config_export' definition in its annotation in Drupal\Core\Config\Entity\ConfigEntityBase->toArray() (line 252 of /var/www/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php).

Steps to reproduce

Install module, click "+ config link"

Fill out fields and hit save.
New Item not saved and error returned.

Proposed resolution

Add config_export to annotation in src/Entity/MenuLinkConfig.php

/**
 * Defines the menu link config entity.
 *
 * @ConfigEntityType(
 *   id = "menu_link_config",
 *   label = @Translation("Menu link config"),
 *   handlers = {
 *     "access" = "\Drupal\Core\Entity\EntityAccessControlHandler",
 *     "form" = {
 *       "default" = "\Drupal\menu_link_config\Plugin\Menu\Form\MenuLinkConfigForm"
 *     }
 *   },
 *   admin_permission = "administer menu link config",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "title",
 *     "status" = "status"
 *   },
 *  config_export = {
 *     "id",
 *     "title",
 *     "url",
 *     "route_name",
 *     "route_parameters",
 *     "options",
 *     "expanded",
 *     "menu_name",
 *     "parent",
 *     "weight",
 *     "description",
 *     "enabled"
 *   },
 * )
 */

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada z1pp3r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024