This edition of the Core Weekly report highlights changes in PrestaShop’s core codebase from Monday 8th to Sunday 14th of August 2022.
Last week maintainers team released PrestaShop 8 Beta. This is a major release, and your feedback is essential. You can report bugs on Github or contribute to fixing bugs. The team is waiting for your feedback until September 5, 2022.
A quick update about PrestaShop’s GitHub issues and pull requests:
- 35 new issues have been created in the project repositories;
- 39 issues have been closed, including 23 fixed issues on the core;
- 43 pull requests have been opened in the project repositories;
- 41 pull requests have been closed, including 36 merged pull requests.
Code changes in the ‘develop’ branch
- #29113: More data available for the productoutofstock email, by @kpodemski
- #26788: Cart: replace this->getAssociatedLanguage()->getId() by equivalent th…. Thank you @lmeyer1
- #29161:  Fix update order status settings with readonly user. Thank you @FabienPapet
- #29114: BO > Customers > Addresses - Required fields are not used in back office. Thank you @okom3pom
- #28762: Target the table on the reload of the page after a sort, by @Progi1984
- #28441: IP white list should not be preconfigured. Thank you @lmeyer1
- #27987: States : Migrate Add & Edit Forms, by @Progi1984
Code changes in the ‘8.0.x’ branch
- #29306: Fix specific price creation for dedicated customer. Thank you @zuk3975
- #29278: Fix undefined quantity index in light product list. Thank you @zuk3975
- #29272: Making PHP8.1 implicit conversion explicit. Thank you @FabienPapet
- #29256: When there no module upgrade script to run, make module upgrade succeed, by @Quetzacoalt91
- #29230: Add help.prestashop-project.org documentation links & fix popup opening. Thank you @FabienPapet
- #29180: Fix order payment currency unit. Thank you @FabienPapet
- #28886: Refacto bridge controller initiation and resolve feedback. Thank you @zuk3975
- #28752: Improve extendability of the new product page form, by @jolelievre
- #29311: Functional tests - Skip some steps on ‘FO > Edit information’ test after the new behavior. Thank you @nesrineabdmouleh
- #29290: Fix nightly 8.0.x - 09/08/2022 - ‘Enable/Disable guest checkout’ and ‘Check links in footer page’. Thank you @nesrineabdmouleh
- #28846: Functional tests - Add new test ‘Change Currency’ in FO. Thank you @sallemiines
Code changes in the ‘1.7.8.x’ branch
- #29307: Remove module_card.js from the product page v1, by @NeOMakinG
- #29214: Fix logo on pdf for RTL. Thank you @MeKeyCool
Code changes in modules, themes & tools
Changes in developer documentation sources
- #1443: Backport of 1442. Thank you @leemyongpakvn
- #1442: Fix minor typo and syntax. Thank you @leemyongpakvn
Core Weekly Generator tool
Module Releases Monitor
Faceted search module
- #692: Fix: BO - New filters template - an error is displayed in the console when we click save. Thank you @leemyongpakvn
Customer reassurance block module
- #432: Fix: BO - Titles are not well displayed (overlap labels) with mobile. Thank you @leemyongpakvn
- #430: Fix: non-svg custom icon is hidden in FO after editing in BO. Thank you @leemyongpakvn
Product Comments module
Thank you to the contributors whose pull requests were merged since the last Core Weekly Report: @ga-devfront, @kpodemski, @nesrineabdmouleh, @NeOMakinG, @zuk3975, @dependabot[bot], @JBLach, @leemyongpakvn, @jolelievre, @FabienPapet, @Quetzacoalt91, @MeKeyCool, @matthieu-rolland, @okom3pom, @sallemiines, @Progi1984, @lmeyer1, @idnovate!
Thank you to the contributors whose PRs haven’t been merged yet! And of course, a big thank you to all those who contribute with issues and comments on GitHub!
If you want to contribute to PrestaShop with code, please read these pages first:
…and if you do not know how to fix an issue but wish to report it, please read this: How to use GitHub to report an issue. Thank you!
Happy contributin’ everyone!
- Category: Dev News
We’re all looking for ways to grow our audiences for our sites. Sometimes, we change our content to optimize it for search engines (here’s a shameless plug for our new SEO course). Other times, we find ways to reach new people, such as using tags so our blog posts show up in the Reader.
Now, WordPress.com creators are getting access to an all-new tool to increase their audience.
Originally released as Microsoft News, the revamped Microsoft Start is a global news and information feed that currently syndicates content from over 4,500 premium publishers to about a billion people! In an effort to expand and diversify this network, Microsoft has started an exclusive pilot program — and is looking for 500 highly qualified, independent creators in the U.S. to apply.
Yes, this means you.
Using the Microsoft Start plugin to connect your site to the platform, you’ll be able to build your brand and gain exposure by delivering your content throughout Microsoft Start’s ecosystem, which includes MSN, Bing, and Microsoft Edge. Additionally, you’ll be able to earn ad-sharing revenue via the platform, as well as 100% direct support through readers and your affinity links. Creators on the Microsoft Start platform act as their own syndicator and will maintain 100% ownership of their content. Even better, previously published posts can be repurposed as evergreen content using the built-in WordPress.com feed functionality.
Do you qualify?
Desired applicants are reputable topic specialists publishing content at least 5 times per month. Priority will be given to the following genres: food and drink; travel; health and wellness (which includes nutrition and fitness); relationships; parenting; demystifying science and tech; career and personal finance; the craft of writing; and DIY how-tos. Ideally, you also have an archive of at least 25 blog posts.
If you’re interested in applying, Microsoft will sweeten the deal by paying 500 accepted candidates a $100 bonus upon publishing regularly for 60 days. (To qualify, candidates must submit their application by 11:59pm PDT on Sunday August 28, 2022 and enter “WordPress” as your referral.) Please note that there are terms and conditions all participating publishers must agree to in order to work directly with Microsoft Start. This opportunity is not an affiliate program between Microsoft Start and WordPress.com; it’s simply a special, limited-time opportunity we’ve helped to leverage for WordPress.com creators.
- Category: Dev News
PrestaShop 8 beta version was released last week. If you are a developer in our ecosystem, create modules or themes, and have clients working with PrestaShop, this is an excellent opportunity to spend some time with this version and test your solutions.
In this article, I will focus on things that might affect your work. You will read here about changes that are not backward compatible, and could require you to make changes in the code of your solutions.
It is worth noting that PrestaShop 8 is a new major version. Although it is an evolution rather than a revolution, you will find several software code changes that can significantly impact some of you.
As always, we have done our best to make all important information about changes available in the developer documentation. This article is an introduction and explanation to the content you will find there.
PHP 8.0 and 8.1
PrestaShop 8 brings support for… PHP 8 and 8.1. This is one of the most important elements of the upgrade to version 8. Each new PHP version brings better performance and many features that will make the developers’ work easier. This does not mean that PrestaShop will require PHP 8.1, the minimum compatible version is PHP 7.2.5, but we recommend using the latest available PHP version when possible. Security is a serious matter (always), and PHP 8.1 guarantees support with security updates until November 2024.
We recommend making your solutions compatible with the same range of PHP versions as PrestaShop is compatible with (that is, 7.2~8.1). For this, you must make sure not to use the language features introduced in PHP versions that are more recent than PHP 7.2. At the same time, in order to make your code work with PHP 8.1, you must make sure to take into account all features that might have been deprecated or removed in PHP 8 and 8.1, and avoid using them. The list of backward incompatible changes and new deprecations is available on the PHP website:
PrestaShop’s code also had to be modified to become compatible with the two PHP versions. You can find details of modifications in these Pull Requests:
This could give you an overview of what you might face while upgrading.
One of the changes that can directly impact many solutions that
work with PrestaShop is the
change, which has been renamed to
Attribute is now
reserved in PHP, hence the need for this change.
Updating PHP and Symfony required some of the dependencies used in the project to be updated. You can find the list of updates here: List of updated dependencies.
If your solution uses one of the updated libraries, you may need to update your code to be compatible with the updated versions. Check the websites of the library creators for more details.
The Guzzle library has been upgraded from version 5.3 to 7.4. This is worth noting because many libraries use Guzzle as their own dependency, and this library now behaves very differently compared to previous versions. If you use a library that depends on Guzzle 5.3, you might need to update it.
You can find more information and an upgrade guide in the Guzzle repository: Upgrading guide for Guzzle.
PrestaShop 1.7 was the revolution that began the migration to Symfony, first with version 2.8 in earlier releases, and 3.4 since PrestaShop 1.7.4. PrestaShop 8 introduces Symfony 4.4. As major PrestaShop versions are released in the future, expect updates to the Symfony framework as well. This can also affect your solutions.
The notable changes that directly impact PrestaShop users are available here: Notable changes related to Symfony update.
You can find all changes related to adapting PrestaShop to Symfony 4.4 in this Pull Request: Upgrade to Symfony 4.4.
Deprecations and removals
This is probably one of the changes that might have the most significant impact on your solutions.
Many classes and methods marked as “deprecated” in previous
versions have been removed in PrestaShop 8. These were methods that
the core no longer used or that no longer made sense to keep, like
wrappers around natively available PHP functions. A typical example
of these functions are
In this case the change is simple,
must be replaced with
two functions are natively available in PHP.
Depending on your development environment, you might have already noticed these deprecations, as many IDEs like PHPStorm or VSCodehighlight call to deprecated methods and classes. You can find a list of deleted methods, classes, properties, constants, files, Symfony services, and others on this page: Code removals.
Starting with PrestaShop 8, you should see deprecation warnings
on the shop’s logs and front office after enabling developer mode.
Alternatively, you can configure the display of deprecation errors
by setting the error_reporting directive in your PHP
I encourage you to read this list, and if you find any missing items, please let us know.
Changes in methods and their behavior
Removed classes and methods are not the only changes that may cause the need to adjust your solutions.
Several methods have seen changes in their signatures, return types, parameter types, internal behavior, etc. The complete list of changes might give you a better understanding of what changes you will need to apply to update your products. These changes will affect you if your solutions decorate or override default services or classes, or if you invoke the impacted classes and methods directly. We expect typical solutions to require minimal to no changes at all.
Changes in the Hook component
With version 8, PrestaShop will be stricter regarding the implementation and use of hooks in your modules. You must be aware of two changes that may impact your solutions.
The first change concerns Hook registrations that your module does not use. If PrestaShop detects that a module registers for a Hook but doesn’t implement a method for it, an exception will be thrown when in developer mode. This error message is meant to help developers identify errors during module development and should not affect modules in production.
If your PHP configuration is set up to display
you can also expect to see deprecation messages when using hook
aliases. For example, when you register
instead of its correct counterpart,
With the introduction of the new password policy management feature in PrestaShop 8, some solutions may need to be updated. For example, those that generate passwords for customers, or create fake users for external integration purposes.
Pay special attention to the field definitions of the
From now on, these classes require passwords provided as a hash of
appropriate strength according to the settings from the back
If you happen to have a code similar to this:
$customer = new Customer(); $customer->passwd = ‘SomeWeakPassword’; //… $customer->save();
It might not work in this version, as the password score validation can fail.
Since the method
has been removed, here is a better way to handle this scenario:
use PrestaShop\PrestaShop\Adapter\ServiceLocator; use PrestaShop\PrestaShop\Core\Crypto\Hashing; $customer = new Customer(); $crypto = ServiceLocator::get(Hashing::class); $customer->passwd = $crypto->hash(Tools::passwdGen(64)); //… $customer->save();
This example comes from the psgdpr module upgrade file, which had to be upgraded for that exact reason.
To learn more, see the implementation of the new password policy in this Pull Request: Implement a new password policy based on zxcvbn.
Front office and Classic theme
PrestaShop 8 does not include many important changes in the Classic theme. You can see a list here: Change in the classic theme.
The new password policy feature, however, also impacts the storefront. You can put a special widget on the front end that measures password strength. To learn how this was implemented on the Classic Theme: Add strict password policy.
Besides, if you are a theme developer, you might be interested in tracking the improvements implemented in the official Classic repository and porting them to your own theme.
Your feedback is key
The maintainers team is doing its best to keep the documentation up-to-date with all the important changes. However, if you see any irregularities or notice behaviors that should be documented, I encourage you to contribute to the developer documentation.
In upcoming articles, I will introduce you to new features for developers included in PrestaShop 8.
- Category: Dev News
- Category: Dev News
- Category: Dev News
Page 1 of 1132