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

Bump minimum compatibility to PHP 7.1.3 and PS 1.7.7 for Native Modules #32841

Labels
CO Category: Core Developer Feature Developer-oriented feature Feature Type: New Feature Hacktoberfest Identify Hacktoberfest contributions Module Module Quickwin A relatively easy to do Topwatchers Backlog prioritization: issue reported & followed by +6 people

Comments

@leemyongpakvn
Copy link
Contributor

leemyongpakvn commented Jun 6, 2023

Prerequisites

Describe the bug and add attachments

Many native modules are keeping support for PHP 5.6 or even PHP 5.4 like ps_imageslider, ps_languageselector, and many others :). It is a security issue because PHP 5.6 was EOL since 31 Dec 2018, and it also prevents phpstan 0.12 running inside composer.json.
Beside that, we need to drop PHP test for PHP 5.6 and PS 1.7.6 and previous version also.

  • blockreassurance
  • blockwishlist
  • pagesnotfound
  • productcomments
  • ps_emailalerts
  • ps_facetedsearch
  • ps_googleanalytics
  • ps_imageslider
  • ps_languageselector
  • ps_linklist
  • ps_mainmenu
  • ps_newproducts
  • ps_searchbar
  • ps_sharebuttons

Progi1984 already bumped min compat to PHP 7.2 and PS 8.0 for blockwishlist and ps_linklist. I will apply changes for a dozen of modules, other contributors are welcomed to do the rest ;)

Expected behavior

Bump minimum compatibility to PHP 7.1.3 and PS 1.7.7 in composer.json.
Drop PHP test for PHP 5.4 and PS 1.7.6 and previous version.

Steps to reproduce

Please check links in Description.

PrestaShop version(s) where the bug happened

1.7.4, 1.7.5, 1.7.6

PHP version(s) where the bug happened

PHP 5.6

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

@leemyongpakvn leemyongpakvn added Bug Type: Bug New New issue not yet processed by QA labels Jun 6, 2023
@paulnoelcholot
Copy link

Hello,

Thanks for reporting this issue!
Ping @PrestaShop/prestashop-core-developers : Could someone please try to reproduce the issue, it's too technical!

Thanks in advance!

@paulnoelcholot paulnoelcholot added 1.7.4.0 Affects versions 1.7.5.0 Affects versions 1.7.6.0 Affects versions TBR Status: issue to be reproduced Waiting for dev Status: action required, waiting for tech feedback CO Category: Core Module Module and removed New New issue not yet processed by QA labels Jun 6, 2023
@matks
Copy link
Contributor

matks commented Jun 6, 2023

Hello @leemyongpakvn I think it's a great idea 👍

In a module, we cannot mark "this module is NOT compatible with PHP {...}" (we can mark it in composer.json but it will not be scanned by PrestaShop) however we can mark "this module compatibility range is {...} to {...}"

As each Core version has a dedicated PHP range, it follows.

For example if you say the module minimum Core version is 1.7.7, as 1.7.7 min PHP version is 7.1 then it can be understood as "the module minimum PHP version is 7.1"

I love this idea, but to be sure let me ask the opinion of @PrestaShop/committers

@M0rgan01
Copy link
Contributor

M0rgan01 commented Jun 6, 2023

Indeed, I have already gone through modules in php 5.4 and with older versions of phpstan.
I also think there is work to be done on php versions and some dependencies in modules.

The PHP version of the modules must follow the PHP version of prestashop, taking into account their compatibility range.

@hibatallahAouadni hibatallahAouadni removed 1.7.5.0 Affects versions 1.7.6.0 Affects versions labels Jun 6, 2023
@kpodemski
Copy link
Contributor

I like the idea.

@leemyongpakvn
Copy link
Contributor Author

leemyongpakvn commented Jun 6, 2023

@matks I chose PHP 7.1.3 and PS 1.7.7 because of this composer.json.
Furthermore, I suggest removing

    "platform": {
      "php": "5.6"
    }

from module's composer.json. That way, we can keep support for PHP 7.1.3 and PS 1.7.7 in production environment (merchants won't be shocked ;), while allow devs using php-dev-tools v4 and php-cs-fixer v3 (those require PHP 7.2) in development environment.

@boherm
Copy link
Member

boherm commented Jun 6, 2023

@leemyongpakvn, it seems to be a good idea to me for PHP 7.1 instead of oldies versions.

@kpodemski
Copy link
Contributor

@leemyongpakvn yes, that's a good idea, because if you have platform requirement composer will throw you a warning if you don't meet requirements, so if we have:

   "platform": {
      "php": "5.6"
    }

and you, for example, generate autoloader, i'll check whether the version of PHP is correct

@matks matks added Developer Feature Developer-oriented feature Ready Status: Issue is ready to be worked on Feature Type: New Feature and removed TBR Status: issue to be reproduced Waiting for dev Status: action required, waiting for tech feedback Bug Type: Bug 1.7.4.0 Affects versions labels Jun 6, 2023
@matks
Copy link
Contributor

matks commented Jun 6, 2023

Idea approved 👍 and I change the labels: it's not a Bug it's a Feature

@Hlavtox
Copy link
Contributor

Hlavtox commented Jun 7, 2023

Full list:

Module Min version Status
ps_googleanalytics 1.7.7 OK
blockreassurance 1.7.7 OK
ps_themecusto 1.7 Needs bump
autoupgrade 1.7.0.0 Needs bump
ps_bestsellers 1.7.0.0 Needs bump
ps_brandlist 1.7.0.0 Needs bump
ps_categoryproducts 1.7.0.0 Needs bump
ps_newproducts 1.7.0.0 Needs bump
ps_specials 1.7.0.0 Needs bump
ps_supplierlist 1.7.0.0 Needs bump
ps_viewedproduct 1.7.0.0 Needs bump
dashgoals 1.7.1.0 Needs bump
graphnvd3 1.7.1.0 Needs bump
gridhtml 1.7.1.0 Needs bump
gsitemap 1.7.1.0 Needs bump
pagesnotfound 1.7.7 OK
ps_banner 1.7.1.0 Needs bump
ps_categorytree 1.7.1.0 Needs bump
ps_customersignin 1.7.1.0 Needs bump
ps_emailsubscription 1.7.1.0 Needs bump
ps_featuredproducts 1.7.1.0 Needs bump
ps_languageselector 1.7.1.0 Needs bump
ps_mainmenu 1.7.1.0 Needs bump
ps_sharebuttons 1.7.1.0 Needs bump
ps_shoppingcart 1.7.1.0 Needs bump
statsbestcustomers 1.7.1.0 Needs bump
statsbestmanufacturers 1.7.1.0 Needs bump
statsbestsuppliers 1.7.1.0 Needs bump
statscarrier 1.7.1.0 Needs bump
statsdata 1.7.1.0 Needs bump
statscheckup 1.7.1.0 Needs bump
statsnewsletter 1.7.1.0 Needs bump
statspersonalinfos 1.7.1.0 Needs bump
statsregistrations 1.7.1.0 Needs bump
statssearch 1.7.1.0 Needs bump
contactform 1.7.2.0 Needs bump
ps_contactinfo 1.7.2.0 Needs bump
ps_crossselling 1.7.2.0 Needs bump
ps_dataprivacy 1.7.2.0 Needs bump
ps_customeraccountlinks 1.7.4.0 Needs bump
ps_imageslider 1.7.4.0 Needs bump
ps_socialfollow 1.7.4.0 Needs bump
ps_currencyselector 1.7.5.0 Needs bump
ps_customtext 1.7.5.0 Needs bump
productcomments 1.7.7 OK
dashproducts 1.7.6.0 Needs bump
dashtrends 1.7.6.0 Needs bump
ps_cashondelivery 1.7.6.0 Needs bump
ps_emailalerts 1.7.6.0 Needs bump
ps_facetedsearch 1.7.6.0 Needs bump
ps_faviconnotificationbo 1.7.6.0 Needs bump
ps_checkpayment 1.7.6.0 Needs bump
ps_wirepayment 1.7.6.0 Needs bump
statsbestcategories 1.7.6.0 Needs bump
statsbestproducts 1.7.6.0 Needs bump
statsbestvouchers 1.7.6.0 Needs bump
statscatalog 1.7.6.0 Needs bump
statsforecast 1.7.6.0 Needs bump
statsproduct 1.7.6.0 Needs bump
statssales 1.7.6.0 Needs bump
statsstock 1.7.6.0 Needs bump
welcome 1.7.6.0 Needs bump
dashactivity 1.7.7.0 OK
ps_searchbar 1.7.8.0 OK
blockwishlist 8.0.0 OK
psgdpr 8.0.0 OK
ps_distributionapiclient 8.0.2 OK
ps_linklist 8.1.0 OK

@prestashop-issue-bot prestashop-issue-bot bot added the Topwatchers Backlog prioritization: issue reported & followed by +6 people label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment