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

Template Override dialog provides incompatible options #602

Closed
DmitryFurs opened this issue Jun 11, 2021 · 5 comments · Fixed by #1046
Closed

Template Override dialog provides incompatible options #602

DmitryFurs opened this issue Jun 11, 2021 · 5 comments · Fixed by #1046

Comments

@DmitryFurs
Copy link
Contributor

Describe the bug

When trying to overwrite a template / image / css / js files, there is an ability to select options Override Layout and Extend Layout. These options apply only to layouts and there may be an option to extend or overwrite .less files.

To Reproduce

Steps to reproduce the behavior:

  1. Go to templates folder in any module.
  2. Right Click on any phtml file.
  3. Choose Override this template in a project theme.
  4. See incompatible options in dialog box.

Expected behavior

If a developer tries to overwrite templates or any other type of files that are not supported by the file type, do not offer them these options, because if he select the Override option, the template path will have extra folders in the path, which will not lead to overriding and the resulting template will not be a participant.

If a developer tries to overwrite / extend the _module.less file, another mechanism should be provided https://devdocs.magento.com/guides/v2.4/frontend-dev-guide/css-guide/css_quick_guide_approach.html
If the file is extending, then the plugin need to create an empty _extend.less file, to which the necessary content will be added by the developer. If the overwrite option is selected, the file to be overwritten should be copied to the main path as _module.less.

Screenshots

image
image
image

Please complete the following information:

  • OS: MacOS 11.4
  • PhpStorm version: PhpStorm 2021.1.3
  • Plugin Version: 3.2.2

Additional context

The override option always says that we are overriding the template, this option should adapt to the type of file being overwritten (template, layout, css, less, js, image, and so on).
image

@DmitryFurs DmitryFurs added the bug label Jun 11, 2021
@m2-assistant
Copy link

m2-assistant bot commented Jun 11, 2021

Hi @DmitryFurs. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@AZiniukhin
Copy link

@magento I am working on this

@bohdan-harniuk
Copy link
Collaborator

Hello, @AZiniukhin!

What is your progress here?

Regards,

@bohdan-harniuk
Copy link
Collaborator

bohdan-harniuk commented Mar 19, 2022

Hello, @AZiniukhin!

@SilinMykola will take care of this issue. He is rewriting this feature from stretch:

  1. [Bug] ArrayIndexOutOfBoundsException in OverrideInThemeDialog.fillThemeOptions #1026
  2. Not possible to override the js/css files from the lib/web/* folder #603

Thank you for your work here.

Regards,

@SilinMykola
Copy link

@magento I am working on this

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

Successfully merging a pull request may close this issue.

4 participants