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

Custom theme couldn't be detected #1517

Closed
webcreative24 opened this issue Apr 13, 2023 · 11 comments · Fixed by #1532 or #2348
Closed

Custom theme couldn't be detected #1517

webcreative24 opened this issue Apr 13, 2023 · 11 comments · Fixed by #1532 or #2348
Assignees
Labels

Comments

@webcreative24
Copy link

webcreative24 commented Apr 13, 2023

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: (*)

  • OS: Ubuntu Linux 20.04
  • PhpStorm 2022.3.2
  • Plugin Version: 5.0.1
@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2023

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
Copy link
Author

@magento I am working on this

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2023

Hi @webcreative24! 👋
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
Copy link
Author

@magento add to contributors team

@m2-assistant
Copy link

m2-assistant bot commented Apr 13, 2023

Hi @webcreative24! 👋
Thank you for joining. Please accept team invitation 👉 here 👈 and add your comment one more time.

@webcreative24
Copy link
Author

@magento I am working on this

@DmitryFurs
Copy link
Contributor

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
Copy link
Contributor

Thanks @DmitryFurs

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

@VitaliyBoyko VitaliyBoyko reopened this Apr 17, 2023
@VitaliyBoyko VitaliyBoyko self-assigned this Apr 17, 2023
@VitaliyBoyko
Copy link
Contributor

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

Little too much freedom, I would say 😄

@DanieliMi
Copy link

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

  • app/design/frontend/Vendor/Theme1
  • app/design/frontend/Vendor/Theme2
  • app/design/frontend/Vendor/Theme3
    None of these are displayed, only the Hyvä themes:
    ksnip_20230613-124152
    It seems only themes in vendor/ are detected.

@sdouma
Copy link

sdouma commented Aug 14, 2023

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants