Skip to content

Commit 87633f4

Browse files
committed
Merge branch 'develop' into introduce-objectModel-comparator
2 parents 20e4352 + 327e0af commit 87633f4

File tree

1,068 files changed

+5414
-3354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,068 files changed

+5414
-3354
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://devdocs.prestashop-project.org/9/contribute/contribution-guidelines/pull
1212

1313
| Questions | Answers
1414
| ----------------- | -------------------------------------------------------
15-
| Branch? | develop / 8.2.x
15+
| Branch? | develop / 9.0.x / 8.2.x
1616
| Description? | Please be specific when describing the PR. <br> Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table.
1717
| Type? | bug fix / improvement / new feature / refacto
1818
| Category? | FO / BO / CO / IN / WS / TE / LO / ME / PM / see explanations at https://devdocs.prestashop-project.org/9/contribute/contribution-guidelines/pull-requests/#type--category

.github/workflows/cron_js_routing.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ jobs:
1818
matrix:
1919
BRANCH:
2020
- develop
21+
- 9.0.x
22+
- 8.2.x
2123
- 8.1.x
2224
- 8.0.x
2325
include:
2426
- BRANCH: develop
25-
node: 16
26-
- BRANCH: 8.1.x
27-
node: 16
28-
- BRANCH: 8.0.x
27+
node: 20
28+
- BRANCH: 9.0.x
29+
node: 20
30+
- BRANCH: 8.2.x
2931
node: 16
3032

3133
env:

.github/workflows/cron_nightly_build.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ jobs:
2020
matrix:
2121
BRANCH:
2222
- develop
23+
- 9.0.x
2324
- 8.2.x
2425
- 8.1.x
2526
- 8.0.x
2627
- 1.7.8.x
2728
include:
2829
- BRANCH: develop
29-
node: 16
30+
node: 20
31+
- BRANCH: 9.0.x
32+
node: 20
3033
- BRANCH: 8.2.x
3134
node: 16
3235
- BRANCH: 8.1.x
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This workflow aim to run all UI tests on active branches
2+
# and upload the report on Google cloud platform storage
3+
name: Nightly tests and report - 9.0.x
4+
5+
on:
6+
workflow_run:
7+
workflows: [ 'Nightly Build' ]
8+
types:
9+
- requested
10+
11+
jobs:
12+
test_9_0_x:
13+
uses: ./.github/workflows/cron_nightly_tests_reusable.yml
14+
with:
15+
BRANCH: 9.0.x
16+
PHP_VERSION: '8.1'
17+
NODE_VERSION: '20'
18+
DB_SERVER: 'mariadb'
19+
secrets:
20+
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
21+
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This workflow aim to run all UI tests on active branches
2+
# and upload the report on Google cloud platform storage
3+
name: Nightly tests and report - 9.0.x
4+
5+
on:
6+
workflow_run:
7+
workflows: [ 'Nightly Build' ]
8+
types:
9+
- requested
10+
11+
jobs:
12+
test_9_0_x:
13+
uses: ./.github/workflows/cron_nightly_tests_reusable.yml
14+
with:
15+
BRANCH: 9.0.x
16+
PHP_VERSION: '8.1'
17+
NODE_VERSION: '20'
18+
DB_SERVER: 'mysql'
19+
secrets:
20+
GC_PROJECT_ID: ${{ secrets.GC_PROJECT_ID }}
21+
GC_SERVICE_KEY: ${{ secrets.GC_SERVICE_KEY }}

.github/workflows/cron_nightly_tests_reports.yml

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
database: mysql
2727
- branch: 8.2.x
2828
database: mysql
29+
- branch: 9.0.x
30+
database: mysql
31+
- branch: 9.0.x
32+
database: mariadb
2933
- branch: develop
3034
database: mysql
3135
- branch: develop

.github/workflows/cron_nightly_tests_reusable.yml

+11
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,17 @@ jobs:
176176
CAMPAIGN: 'functional:FO:hummingbird:04-07'
177177
- BRANCH: 8.2.x
178178
CAMPAIGN: 'functional:FO:hummingbird:08-12'
179+
## 9.0.x
180+
- BRANCH: 9.0.x
181+
CAMPAIGN: 'functional:FO:01-03'
182+
- BRANCH: 9.0.x
183+
CAMPAIGN: 'functional:FO:04-07'
184+
- BRANCH: 9.0.x
185+
CAMPAIGN: 'functional:FO:08-12'
186+
- BRANCH: 9.0.x
187+
CAMPAIGN: 'sanity:productV2'
188+
- BRANCH: 9.0.x
189+
CAMPAIGN: 'functional:productV2'
179190
## develop
180191
- BRANCH: develop
181192
CAMPAIGN: 'functional:FO:01-03'

.github/workflows/cron_php_update_modules.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
matrix:
2020
BRANCH:
2121
- develop
22+
- 9.0.x
2223
- 8.2.x
2324
env:
2425
GH_BRANCH: ${{ matrix.BRANCH }}

.github/workflows/sanity.yml

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ jobs:
8686

8787
- name: Run Tests
8888
uses: ./.github/actions/ui-test
89+
env:
90+
## Improve Webkit stability
91+
## Link : https://github.com/microsoft/playwright/issues/23899
92+
GDK_BACKEND: x11
8993
with:
9094
TEST_CAMPAIGN: ${{ env.TEST_CAMPAIGN }}
9195
BROWSER: ${{ matrix.browser }}

classes/Image.php

+1-7
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
2525
*/
2626

27-
use PrestaShop\PrestaShop\Adapter\ServiceLocator;
2827
use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
2928
use PrestaShop\PrestaShop\Core\Exception\InvalidArgumentException;
3029
use PrestaShop\PrestaShop\Core\Image\ImageFormatConfiguration;
@@ -632,13 +631,8 @@ public function deleteImage($forceDelete = false)
632631

633632
// Delete auto-generated images
634633
$image_types = ImageType::getImagesTypes();
635-
636-
// Get image formats we will be deleting. It would probably be easier to use ImageFormatConfiguration::SUPPORTED_FORMATS,
637-
// but we want to avoid any behavior change in minor/patch version.
638-
$configuredImageFormats = ServiceLocator::get(ImageFormatConfiguration::class)->getGenerationFormats();
639-
640634
foreach ($image_types as $imageType) {
641-
foreach ($configuredImageFormats as $imageFormat) {
635+
foreach (ImageFormatConfiguration::SUPPORTED_FORMATS as $imageFormat) {
642636
$filesToDelete = $this->deleteAutoGeneratedImage($imageType, $imageFormat, $filesToDelete);
643637
}
644638
}

classes/ObjectModel.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -1854,18 +1854,14 @@ public function deleteImage($force_delete = false)
18541854
return false;
18551855
}
18561856

1857-
// Get image formats we will be deleting. It would probably be easier to use ImageFormatConfiguration::SUPPORTED_FORMATS,
1858-
// but we want to avoid any behavior change in minor/patch version.
1859-
$configuredImageFormats = ServiceLocator::get(ImageFormatConfiguration::class)->getGenerationFormats();
18601857
$types = ImageType::getImagesTypes();
1861-
18621858
foreach ($types as $image_type) {
18631859
if (file_exists($this->image_dir . $this->id . '-' . stripslashes($image_type['name']) . '.' . $this->image_format)
18641860
&& !unlink($this->image_dir . $this->id . '-' . stripslashes($image_type['name']) . '.' . $this->image_format)) {
18651861
return false;
18661862
}
18671863

1868-
foreach ($configuredImageFormats as $imageFormat) {
1864+
foreach (ImageFormatConfiguration::SUPPORTED_FORMATS as $imageFormat) {
18691865
$file = $this->image_dir . $this->id . '-' . stripslashes($image_type['name']) . '.' . $imageFormat;
18701866
if (file_exists($file)) {
18711867
unlink($file);

classes/Tools.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,7 @@ public static function generateHtaccess($path = null, $rewrite_settings = null,
22822282

22832283
if ($rewrite_settings) {
22842284
// Compatibility with the old image filesystem
2285-
fwrite($write_fd, "# Images\n");
2285+
fwrite($write_fd, "# Rewrites for product images (support up to < 10 million images)\n");
22862286

22872287
// Rewrite product images < 10 millions
22882288
$path_components = [];
@@ -2293,12 +2293,14 @@ public static function generateHtaccess($path = null, $rewrite_settings = null,
22932293
fwrite($write_fd, $domain_rewrite_cond);
22942294
fwrite($write_fd, 'RewriteRule ^(' . str_repeat('([\d])', $i) . '(?:\-[\w-]*)?)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/p/' . $path . '/$1$' . ($i + 2) . " [L]\n");
22952295
}
2296+
2297+
fwrite($write_fd, "# Rewrites for category images\n");
22962298
fwrite($write_fd, $media_domains);
22972299
fwrite($write_fd, $domain_rewrite_cond);
2298-
fwrite($write_fd, 'RewriteRule ^c/([\d]+)(\-[\.*\w-]*)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3 [L]' . PHP_EOL);
2300+
fwrite($write_fd, 'RewriteRule ^c/([\d]+)(|_thumb)(\-[\.*\w-]*)/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3$4 [L]' . PHP_EOL);
22992301
fwrite($write_fd, $media_domains);
23002302
fwrite($write_fd, $domain_rewrite_cond);
2301-
fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z_-]+)(-[\d]+)?/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3 [L]' . PHP_EOL);
2303+
fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z_-]+)(|_thumb)(-[\d]+)?/.+(\.(?:jpe?g|webp|png|avif))$ %{ENV:REWRITEBASE}img/c/$1$2$3$4 [L]' . PHP_EOL);
23022304
}
23032305

23042306
fwrite($write_fd, "# AlphaImageLoader for IE and fancybox\n");
@@ -2309,7 +2311,7 @@ public static function generateHtaccess($path = null, $rewrite_settings = null,
23092311
}
23102312
// Redirections to dispatcher
23112313
if ($rewrite_settings) {
2312-
fwrite($write_fd, "\n# Dispatcher\n");
2314+
fwrite($write_fd, "\n# Send all other traffic to dispatcher\n");
23132315
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -s [OR]\n");
23142316
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -l [OR]\n");
23152317
fwrite($write_fd, "RewriteCond %{REQUEST_FILENAME} -d\n");

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"prestashop/hummingbird": "dev-develop",
7373
"prestashop/pagesnotfound": "^2",
7474
"prestashop/productcomments": "^7.0",
75-
"prestashop/ps_apiresources": "dev-update-module",
75+
"prestashop/ps_apiresources": "dev-reset-module",
7676
"prestashop/ps_banner": "^2",
7777
"prestashop/ps_bestsellers": "^1.0",
7878
"prestashop/ps_brandlist": "^1.0",
@@ -257,7 +257,7 @@
257257
"repositories": {
258258
"ps_apiresources": {
259259
"type": "vcs",
260-
"url": "https://github.com/jolelievre/ps_apiresources.git"
260+
"url": "https://github.com/jinpresta/ps_apiresources.git"
261261
}
262262
},
263263
"minimum-stability": "dev",

composer.lock

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install-dev/controllers/http/database.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public function display(): void
206206
$this->database_login = $parameters['parameters']['database_user'];
207207
$this->database_password = $parameters['parameters']['database_password'];
208208
$this->database_engine = $parameters['parameters']['database_engine'];
209-
$this->database_prefix = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', mt_rand(1,10))), 0, 5).'_';
209+
$this->database_prefix = substr(str_shuffle(str_repeat('0123456789abcdefghijklmnopqrstuvwxyz', mt_rand(1,10))), 0, 5).'_';
210210

211211
$this->database_clear = true;
212212
$this->use_smtp = false;

install-dev/data/xml/configuration.xml

+3
Original file line numberDiff line numberDiff line change
@@ -897,5 +897,8 @@ Country</value>
897897
<configuration id="PS_ADMIN_API_FORCE_DEBUG_SECURED" name="PS_ADMIN_API_FORCE_DEBUG_SECURED">
898898
<value>1</value>
899899
</configuration>
900+
<configuration id="PS_SEPARATOR_FILE_MANAGER_SQL" name="PS_SEPARATOR_FILE_MANAGER_SQL">
901+
<value>;</value>
902+
</configuration>
900903
</entities>
901904
</entity_configuration>

phpstan-disallowed-calls.neon

+2
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ parameters:
296296
- src/PrestaShopBundle/Controller/Admin/Configure/ShopParameters/OrderStateController.php
297297
- src/PrestaShopBundle/Controller/Admin/Improve/Design/CmsPageController.php
298298
- src/PrestaShopBundle/Controller/Admin/Improve/Design/MailThemeController.php
299+
- src/PrestaShopBundle/Controller/Admin/Improve/International/LanguageController.php
300+
- src/PrestaShopBundle/Controller/Admin/Improve/International/CurrencyController.php
299301
disallowedConstants:
300302
-
301303
constant:

src/Adapter/Backup/BackupRemover.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class BackupRemover implements BackupRemoverInterface
4040
/**
4141
* {@inheritdoc}
4242
*/
43-
public function remove(BackupInterface $backup)
43+
public function remove(BackupInterface $backup): bool
4444
{
4545
$legacyBackup = new PrestaShopBackup($backup->getFileName());
4646

src/Adapter/Backup/DatabaseBackupCreator.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
namespace PrestaShop\PrestaShop\Adapter\Backup;
2828

2929
use PrestaShop\PrestaShop\Adapter\Entity\PrestaShopBackup;
30+
use PrestaShop\PrestaShop\Core\Backup\BackupInterface;
3031
use PrestaShop\PrestaShop\Core\Backup\Exception\BackupException;
3132
use PrestaShop\PrestaShop\Core\Backup\Exception\DirectoryIsNotWritableException;
3233
use PrestaShop\PrestaShop\Core\Backup\Manager\BackupCreatorInterface;
@@ -41,7 +42,7 @@ final class DatabaseBackupCreator implements BackupCreatorInterface
4142
/**
4243
* {@inheritdoc}
4344
*/
44-
public function createBackup()
45+
public function createBackup(): BackupInterface
4546
{
4647
ini_set('max_execution_time', '0');
4748

0 commit comments

Comments
 (0)