Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generate:plugin:annotation] namespace is incorrect #952

Closed
wizonesolutions opened this issue Oct 1, 2015 · 4 comments
Closed

[generate:plugin:annotation] namespace is incorrect #952

wizonesolutions opened this issue Oct 1, 2015 · 4 comments
Assignees
Milestone

Comments

@wizonesolutions
Copy link

This is what I did (I'm on Drupal Console 0.9.1):

✝ fpd8 ✝ /var/www/site/docroot $ drupal generate:plugin:type:annotation

 Welcome to the Drupal Plugin Type generator 

Enter the module name: fillpdf
Plugin type class name [ExamplePlugin]: FillPdfActionPlugin
Plugin type machine name [fill_pdf_action_plugin]: fillpdf_action
Plugin type label [Fill pdf action plugin]: FillPDF action plugin

 Generated or updated files 

Site path: /var/www/site/docroot
1 - modules/fillpdf/src/Annotation/FillPdfActionPlugin.php
2 - modules/fillpdf/src/Plugin/FillPdfActionPluginBase.php
3 - modules/fillpdf/src/Plugin/FillPdfActionPluginInterface.php
4 - modules/fillpdf/src/Plugin/FillPdfActionPluginManager.php
5 - modules/fillpdf/fillpdf.services.yml

The files are generated in src/Plugin, but they have a namespace of Drupal\fillpdf, not Drupal\fillpdf\Plugin. The namespace doesn't match the directory, and PSR-4 won't work.

Also, in fillpdf.services.yml, this was added:

  plugin.manager.fillpdf_action.processor:
    class: Drupal\fillpdf\Plugin\FillPdfActionPluginManager
    parent: default_plugin_manager

The problem is the aforementioned namespace issue.

I can fix the namespaces manually, but without PhpStorm's intelligence telling me that it couldn't resolve FillPdfActionPluginManager this would have thrown me off for a while.

@wizonesolutions
Copy link
Author

Also worth mentioning that every other namespace reference (e.g. in the plugin manager's constructor) seems to be OK and includes the Plugin part.

@jmolivas jmolivas changed the title generate:plugin:annotation namespace is incorrect [generate:plugin:annotation] namespace is incorrect Oct 2, 2015
@jmolivas
Copy link
Member

jmolivas commented Oct 2, 2015

I will test this and reply with more info.

@itsdarrylnorris
Copy link
Contributor

I create a PR (#1742) base on @sanduhrs changes commit. So we can review the PR later on.

jmolivas added a commit that referenced this issue Jan 22, 2016
Correct annotation plugin namespace in templates #952
@jmolivas
Copy link
Member

Fixed on PR #1742

@jmolivas jmolivas added the fixed label Jan 22, 2016
@jmolivas jmolivas modified the milestones: 0.10.6, must-have Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants