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

Replace "else if" smarty conditions by "elseif" as officially recommanded #604

Closed
2 tasks done
Klemart3D opened this issue Feb 29, 2024 · 5 comments
Closed
2 tasks done
Labels
Improvement Refactoring Cleaning and improving the internal structure

Comments

@Klemart3D
Copy link
Contributor

Klemart3D commented Feb 29, 2024

Prerequisites

Describe the bug and add attachments

As recommended by Smarty official documentation an "else-if" condition must be write {elseif} (without space between else and if).

But currently, an else if syntax (with a space between else and if) is currently used:

In comparison, elseif syntax (without space between else and if) is currently used:

Not checked into every Smarty template files (modules, other themes…)

Expected behavior

A uniform smarty else-if syntax following official recommendation everywhere (in each smarty template ".tpl" files of the whole project).

Steps to reproduce

  1. Search for "{else if" in Classic theme codebase

PrestaShop version(s) where the bug happened

1.7.x, 8.x

PHP version(s) where the bug happened

8.1

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

No response

Your company or customer's name goes here (if applicable).

No response

@Klemart3D Klemart3D added the Bug Something isn't working label Feb 29, 2024
@AureRita
Copy link

Hi @Klemart3D

Thank you for your report. Currently you seems to show a feature to add in Prestashop instead of a real issue, If you're agree with that, I can change this issue into a discussion to discuss with the tech-council and product-council

Waiting for your feedback

@Klemart3D
Copy link
Contributor Author

Hi @AureRita,

It's not a feature, it's a refactoring issue to have a more clean code, it's an issue for developers like me because some IDE like phpStorm showing it as an error (because of wrong smarty syntax used):

phpstorm

It can take less than one minute to fix that for team working on native PrestaShop themes, but if you prefer, I can open issue into hummingbird repository?

@MatShir
Copy link

MatShir commented Feb 29, 2024

Let's transfer into hummingbird repo ! If you are willing to contribute, we would be happy to review your work 🤗

@MatShir MatShir transferred this issue from PrestaShop/PrestaShop Feb 29, 2024
@MatShir MatShir added Refactoring Cleaning and improving the internal structure Improvement and removed Bug Something isn't working Waiting for author labels Feb 29, 2024
@Klemart3D
Copy link
Contributor Author

Hi @MatShir , thank you.
I made 2 pull requests :

@SharakPL
Copy link
Contributor

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Refactoring Cleaning and improving the internal structure
Projects
None yet
Development

No branches or pull requests

4 participants