magento / magento2-phpstorm-plugin

PHPStorm Plugin for Magento 2
Open Software License 3.0
436 stars 102 forks source link

Custom theme couldn't be detected #1517

Closed webcreative24 closed 2 weeks ago

webcreative24 commented 1 year ago

Describe the bug (*)

I've created a custom theme in the following folder: app/design/frontend/Vendor/custom-theme. Everything works fine but Magento PHPStorm plugin cannot detect the custom theme when I tried to override core module template

The problem occurs that there is a dash in my custom theme name

To Reproduce (*)

Steps to reproduce the behavior:

  1. Navigate to any of Magento core template files. Ex.: vendor/magento/module-catalog/view/frontend/templates/product/listing.phtml
  2. Click on 'Override file in a project theme'
  3. Click on the Target Theme list dropdown
  4. The dropdown is empty

Expected behavior (*)

The Target theme dropdown should be populated

Screenshots

image

Please complete the following information: (*)

m2-assistant[bot] commented 1 year ago

Hi @webcreative24. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

webcreative24 commented 1 year ago

@magento I am working on this

m2-assistant[bot] commented 1 year ago

Hi @webcreative24! :wave: Thank you for collaboration. Only members of Community Contributors Team are allowed to be assigned to the issue. Please use @magento add to contributors team command to join Contributors team.

webcreative24 commented 1 year ago

@magento add to contributors team

m2-assistant[bot] commented 1 year ago

Hi @webcreative24! :wave: Thank you for joining. Please accept team invitation :point_right: here :point_left: and add your comment one more time.

webcreative24 commented 1 year ago

@magento I am working on this

DmitryFurs commented 1 year ago

Hello @VitaliyBoyko

It seems that now the theme should start with a lowercase letter frontend/Vendor/theme, but in some projects there are themes starting with a capital letter frontend/Vendor/Theme. In such cases, the themes are also not detected.

The documentation does not say that the theme should start with a lowercase letter, it just uses the <theme> placeholder.

But there is such a note:

The folder name conventionally matches naming used in the theme's code: any alphanumeric set of characters, as the vendor sees fit, is acceptable. This convention is merely a recommendation, so nothing prevents naming this directory in another way.

https://developer.adobe.com/commerce/frontend-core/guide/themes/create-storefront/#create-a-theme-directory

Thanks!

VitaliyBoyko commented 1 year ago

Thanks @DmitryFurs

I'll check the 'frontend/Vendor/Theme' case.

VitaliyBoyko commented 1 year ago

'frontend/vendor/theme' is also a possible case and needs to be covered as well.

Little too much freedom, I would say :smile:

DanieliMi commented 1 year ago

This seems to be still an issue in Version 5.1.1. I have three themes:

sdouma commented 1 year ago

ok so here is the current version committed [a-z]+/[a-zA-Z0-9_]+/[a-z][a-zA-Z0-9_]+ https://regex101.com/r/a7GafQ/1

This should be the updated? https://regex101.com/r/a7GafQ/2 [a-z]+/[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+

Or will this be allowing any valid folder/file character?