Skip to content

[generate:plugin:block] Default content broken #4217

@siliconmeadow

Description

@siliconmeadow

[generate:plugin:block] Default content broken

Problem/Motivation

While generating scaffolding for a block, the defaultConfiguration() fn doesn't wrap the user added string in single quotes. Also, the build() fn has a trypo - should be ['#content'], not ['#conten'].

The block class created is broken as a result..

How to reproduce

  1. drupal generate:plugin:block;
  2. Type the module name for which the block is to belong;
  3. Enter the block name;
  4. Enter the plugin label;
  5. Enter the plugin id;
  6. Enter the region (optional);
  7. Enter no when asked about a container;
  8. Choose to generate a form structure;
  9. Create a textarea field;
  10. Enter a label;
  11. Input machine name;
  12. Enter a description;
  13. Enter a default value;
  14. Enter a weight;
  15. Press enter to stop adding fields;
  16. Choose not to create a template;
  17. Choose to complete the operation.
  18. Attempt to add the block through the GUI.

image

image

  • Drupal version 8.8.1.
  • Console version 1.9.4.
  • Console Launcher version 1.9.4.

Solution

Fix to the twig template (#4218 ).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions