Drupal\Component\Plugin\Exception\PluginNotFoundException: The "hidden" plugin does not exist

Created on 2 October 2024, 3 months ago

Problem/Motivation

The following error occurs when you try to make changes to the product form display.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "hidden" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\WidgetPluginManager are: comment_default, datetime_datelist, datetime_default, file_generic, image_image, inline_entity_form_complex, inline_entity_form_simple, link_default, product_widget, path, text_textarea, text_textarea_with_summary, text_textfield, datetime_timestamp, boolean_checkbox, email_default, entity_reference_autocomplete_tags, entity_reference_autocomplete, language_select, number, options_buttons, options_select, string_textarea, string_textfield, uri in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 55 of \core\lib\Drupal\Component\Plugin\Discovery\DiscoveryTrait.php).

Steps to reproduce

I use the drupal 10 version
https://git.drupalcode.org/project/order/-/tree/4a6634e5edefe8607f330bb6...

Drupal 10.3
PHP 8.1

Install inline entity form
Install order
Create a store
Then create a product type

1. Go to manage form display of your new product type,

  • Move cost from disabled to active and click save.
  • Above error occurs and nothing is save.

You can simply just save the form display by doing noting and the same error will occur.

2. The error occurs when you add a new field

  • Go to manage fields and add a field. e.g image
  • The above error will appear when the new field is saved

3. Add a display mode

  • Go to display modes and add a product display
  • The above error occurs and no display is created
πŸ› Bug report
Status

Active

Version

1.0

Component

Bug

Created by

πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

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

Comments & Activities

  • Issue created by @vlooi vlerke
  • πŸ‡ΏπŸ‡¦South Africa vlooi vlerke

    To fix this issue make the following changes

        $fields['user_id'] = BaseFieldDefinition::create('entity_reference')
          ->setLabel(t('Authored by'))
          ->setDescription(t('The user ID of author of the Product entity.'))
          ->setRevisionable(TRUE)
          ->setSetting('target_type', 'user')
          ->setSetting('handler', 'default')
          ->setTranslatable(TRUE)
    -     ->setDisplayOptions('view', [
    -        'type' => 'hidden',
    -     ])
    -      ->setDisplayOptions('form', [
    -        'type' => 'hidden',
    -      ])
          ->setDisplayConfigurable('form', TRUE)
          ->setDisplayConfigurable('view', TRUE);
    
       $fields['status'] = BaseFieldDefinition::create('boolean')
          ->setLabel(t('Publishing status'))
          ->setDescription(t('A boolean indicating whether the Product is published.'))
          ->setRevisionable(TRUE)
          ->setDefaultValue(TRUE)
    -      ->setDisplayOptions('form', [
    -        'type' => 'hidden',
    -      ]);
    + ;
        $fields['cost'] = BaseFieldDefinition::create('float')
          ->setLabel(t('Cost'))
          ->setDescription(t('Product cost.'))
          ->setRevisionable(TRUE)
          ->setDefaultValue(0)
          ->setDisplayOptions('view', [
            'label' => 'above',
    -        'type' => 'float',
    +       'type' => 'number_decimal',
            'weight' => -3,
          ])
          ->setDisplayConfigurable('form', TRUE)
          ->setDisplayConfigurable('view', TRUE)
          ->setRequired(FALSE);
        $fields['store'] = BaseFieldDefinition::create('entity_reference')
          ->setLabel(t('Store'))
          ->setDescription(t('The store this product belongs to.'))
          ->setSetting('target_type', 'store')
          ->setSetting('handler', 'default')
          ->setRevisionable(TRUE)
          ->setDefaultValue('')
          ->setDisplayOptions('form', [
            'type' => 'entity_reference_select',
            'weight' => -3,
          ])
    -      ->setDisplayOptions('view', [
    -        'type' => 'hidden',
    -      ])
          ->setDisplayConfigurable('form', TRUE)
          ->setDisplayConfigurable('view', TRUE)
          ->setRequired(TRUE);
Production build 0.71.5 2024