-
-
Notifications
You must be signed in to change notification settings - Fork 554
Closed
Description
Problem/Motivation
When a plugin skeleton is generated the namespace is broken in at least one situation
Details to include:
The generated code needs to be updated to include proper name spacing so that a generated plugin will run without errors.
How to reproduce
I followed instruction at https://docs.drupalcommerce.org/commerce2/developer-guide/checkout/create-custom-checkout-pane and ended up with a non-functioning plugin.
Details to include:
- Drupal version 8.6.2
- Console version 1.8.0
- Console Launcher version 1.8.0
After running the commands
drupal generate:module \
--module="My checkout pane" \
--machine-name="my_checkout_pane" \
--module-path="modules/custom" \
--description="My checkout pane" \
--core="8.x" \
--package="Custom" \
--composer \
--dependencies="commerce:commerce_checkout"
and
drupal generate:plugin:skeleton \
--module="my_checkout_pane" \
--plugin-id="commerce_checkout_pane" \
--class="CustomCompletionMessage"
I was presented with a plugin that began
<?php
namespace Drupal\my_checkout_pane\Plugin\CommerceCheckoutPane;
use Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane\CheckoutPaneInterface;
Located structurally in modules/custom/my_checkout_pane/src/Plugin/Commerce/CheckoutPane. Because of this the namespace line should read
namespace Drupal\my_checkout_pane\Plugin\Commerce\CheckoutPane;
(a backslash character entered between Commerce and CheckoutPane)
Metadata
Metadata
Assignees
Labels
No labels