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

Extending parent theme template breaks dependant templates #30712

Open
2 tasks done
Tracked by #23176
rmilecki opened this issue Jan 1, 2023 · 3 comments
Open
2 tasks done
Tracked by #23176

Extending parent theme template breaks dependant templates #30712

rmilecki opened this issue Jan 1, 2023 · 3 comments
Labels
1.7.7.8 Affects versions Bug Type: Bug FO Category: Front Office Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Ready Status: Issue is ready to be worked on Theme & logo Label: Which BO under menu is concerned Verified The issue has been reproduced

Comments

@rmilecki
Copy link

rmilecki commented Jan 1, 2023

Prerequisites

Describe the bug and add attachments

According to the documentation it should be possible to extend parent theme to introduce small changes (e.g. modify a single template block):
https://devdocs.prestashop-project.org/1.7/themes/reference/template-inheritance/parent-child-feature/

In documentation example product-list.tpl gets extended.

The problem (bug) is that extending product-list.tpl breaks templates that extend product-list.tpl (e.g. category.tpl).

Expected behavior

Extending product-list.tpl should allow modifying that template without affecting behaviour of any other templates.

Steps to reproduce

  1. Go to the Design → Theme & Logo
  2. Use Add new theme
  3. Use Import from your computer to install childtest.zip
  4. Switch to the "Child Theme Test" theme

PrestaShop version(s) where the bug happened

1.7.8.8 8.0.0

PHP version(s) where the bug happened

7.2.34 7.3.32

If your bug is related to a module, specify its name and its version

No response

@rmilecki rmilecki added Bug Type: Bug New New issue not yet processed by QA labels Jan 1, 2023
@rmilecki
Copy link
Author

rmilecki commented Jan 1, 2023

My childtest theme contains a very simple product-list.tpl file:

{extends file='parent:catalog/listing/product-list.tpl'}

{block name='content' prepend}
  <h1>Child Theme test</h1>
{/block}

Original behaviour

original

Expected behaviour

expected

Actual (bugged) behaviour

bugged

As you can see extending product-list.tpl (e.g. to modify an existing block) breaks themes/classic/templates/catalog/listing/category.tpl. For some reason category.tpl which provides a nice category header doesn't work anymore.

@AureRita
Copy link
Contributor

AureRita commented Jan 3, 2023

Hi @rmilecki ,

I reproduce the issue with PrestaShop version 1.7.7.8, I'll add this to the backlog so it can be fixed.

Please be aware that some issues might take a very long time to be resolved. If this one is important to you and you cannot wait for it to be fixed on the project’s own time, we strongly suggest you consider contacting a professional to help you.

If you fix the issue on your end, please contribute it back to the project. Remember that the more people contribute, the better PrestaShop becomes for everyone.

It's maybe because you didn't have a category.tpl on your childtest.zip that you have this issue ( if I add you line on the product-list.tpl I can't go on a page with the faceted search as we can see here )

image

Thanks

@AureRita AureRita added FO Category: Front Office Needs Specs Status: issue needs to be specified Theme & logo Label: Which BO under menu is concerned 1.7.7.8 Affects versions Verified The issue has been reproduced Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification and removed New New issue not yet processed by QA labels Jan 3, 2023
@rmilecki
Copy link
Author

rmilecki commented Jan 3, 2023

It's maybe because you didn't have a category.tpl on your childtest.zip that you have this issue

That's correct, adding all dependant templates to the child theme can be used as a workaround. It can be cumberstone though as there are many templates referencing product-list.tpl.

@AureRita AureRita added Ready Status: Issue is ready to be worked on and removed Needs Specs Status: issue needs to be specified labels Jan 3, 2023
@AureRita AureRita mentioned this issue Jan 3, 2023
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.7.8 Affects versions Bug Type: Bug FO Category: Front Office Minor Severity: minor bug > https://build.prestashop.com/news/severity-classification Ready Status: Issue is ready to be worked on Theme & logo Label: Which BO under menu is concerned Verified The issue has been reproduced
Projects
None yet
Development

No branches or pull requests

2 participants