How did I port the Magento 2.4.4 core file modifications of cabinetsbay.com to Magento 2.4.7-p2?

Step 1

Restore .editorconfig.

Step 2

Restore .gitignore.

Step 3

git status

2024-08-25--21-52-39

It shows the list of Magento 2.4.4 core file modifications which were overwritten by the Magento 2.4.7-p2 upgrade:

  • lib/web/requirejs/require.js
  • pub/get.php
  • setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php
  • vendor/magento/framework/Filter/Template.php
  • vendor/magento/framework/Filter/Template/SignatureProvider.php
  • vendor/magento/framework/Image/Adapter/Gd2.php
  • vendor/magento/framework/Interception/PluginListGenerator.php
  • vendor/magento/framework/View/Element/Template/File/Validator.php
  • vendor/magento/module-catalog/Model/View/Asset/Image.php
  • vendor/magento/module-cms/Model/Page/DataProvider.php
  • vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php
  • vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php
  • vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php
  • vendor/magento/module-security/Model/AdminSessionInfo.php

Step 4

Copy the Magento 2.4.4 core file modifications from the backup to a separate folder:

rm -rf ../patch
mkdir -p ../patch
chmod -R -v 777 ../patch
cp --parents lib/web/requirejs/require.js ../patch
cp --parents pub/get.php ../patch
cp --parents setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php ../patch
cp --parents vendor/magento/framework/Filter/Template.php ../patch
cp --parents vendor/magento/framework/Filter/Template/SignatureProvider.php ../patch
cp --parents vendor/magento/framework/Image/Adapter/Gd2.php ../patch
cp --parents vendor/magento/framework/Interception/PluginListGenerator.php ../patch
cp --parents vendor/magento/framework/View/Element/Template/File/Validator.php ../patch
cp --parents vendor/magento/module-catalog/Model/View/Asset/Image.php ../patch
cp --parents vendor/magento/module-cms/Model/Page/DataProvider.php ../patch
cp --parents vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php ../patch
cp --parents vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php ../patch
cp --parents vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php ../patch
cp --parents vendor/magento/module-security/Model/AdminSessionInfo.php ../patch

2024-08-25--22-23-26

Step 5

Compare the result of the Step 4 with the current code (after composer update):

2024-08-25--22-26-51

2024-08-25--22-28-13

Step 6. lib/web/requirejs/require.js

6.1.

6.2. It is related to:

6.3.

The file is the same in Magento 2.4.4 and 2.4.7-p2, so I just copied my modified file from 2.4.4 to 2.4.7-p2.

Step 7. pub/get.php

7.1.

7.2. It is related to:

7.2.1.

How to adapt pub/get.php to Windows in Magento ≥ 2.4.2?

7.2.2.

7.3.

Step 8. setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php

8.1.

8.2. It is related to:

How to fix interceptors generation on bin/magento setup:di:compile in Magento ≥ 2.2 in Windows?

8.3.

The file is the same in Magento 2.4.4 and 2.4.7-p2, so I just copied my modified file from 2.4.4 to 2.4.7-p2.

Step 9. vendor/magento/framework/Filter/Template.php

9.1.

9.2. It is related to:

9.3.

I modified the vendor/magento/framework/Filter/Template.php to implement the «ACSD-47578» security patch.
Magento 2.4.7-p2 does not need the patch.
So, I just replaced my modified file with the file from 2.4.7-p2, and removed the file from my Git repository:

Step 10. vendor/magento/framework/Filter/Template/SignatureProvider.php

10.1.

10.2. It is related to:

10.3.

Step 11. vendor/magento/framework/Image/Adapter/Gd2.php

11.1.

11.2. It is related to:

How to fix catalog images in Magento ≥ 2.3.5 in Windows?

11.3.

Step 12. vendor/magento/framework/Interception/PluginListGenerator.php

12.1.

12.2. It is related to:

How to fix «file_put_contents(generated/metadata/primary|global|plugin-list.php): failed to open stream: No such file or directory in lib\internal\Magento\Framework\Interception\PluginListGenerator.php on line 414» in Magento 2.4-develop in Windows?

12.3.

Step 13. vendor/magento/framework/View/Element/Template/File/Validator.php

13.1.

13.2. It is related to:

How to fix the «Invalid template file» / «require_js.phtml» failure for 2.3 ≤ Magento < 2.4.5 in Windows?

13.3.

Step 14. vendor/magento/module-catalog/Model/View/Asset/Image.php

14.1.

14.2. It is related to:

How to adapt Magento\Catalog\Model\View\Asset\Image::getUrl() to Windows in Magento ≥ 2.4.2?

14.3.

Step 15. vendor/magento/module-cms/Model/Page/DataProvider.php

15.1.

15.2. It is related to:

15.3.

Step 16. vendor/magento/module-sales/Model/Order/Email/Sender/CreditmemoSender.php

16.1.

16.2. It is related to:

How did I fix «Environment emulation nesting is not allowed» on sending invoice / shipment / creditmemo emails in 2.4.4 ≤ Magento < 2.4.7-beta2?

16.3.

Magento 2.4.7-p2 already implements my patch.
So, I just replaced my modified file with the file from 2.4.7-p2, and removed the file from my Git repository:

Step 17. vendor/magento/module-sales/Model/Order/Email/Sender/InvoiceSender.php

17.1.

17.2. It is related to:

How did I fix «Environment emulation nesting is not allowed» on sending invoice / shipment / creditmemo emails in 2.4.4 ≤ Magento < 2.4.7-beta2?

17.3.

Magento 2.4.7-p2 already implements my patch.
So, I just replaced my modified file with the file from 2.4.7-p2, and removed the file from my Git repository:

Step 18. vendor/magento/module-sales/Model/Order/Email/Sender/ShipmentSender.php

18.1.

18.2. It is related to:

How did I fix «Environment emulation nesting is not allowed» on sending invoice / shipment / creditmemo emails in 2.4.4 ≤ Magento < 2.4.7-beta2?

18.3.

Magento 2.4.7-p2 already implements my patch.
So, I just replaced my modified file with the file from 2.4.7-p2, and removed the file from my Git repository:

Step 19. vendor/magento/module-security/Model/AdminSessionInfo.php

19.1.

19.2. It is related to:

How did I fix «strtotime() expects parameter 1 to be string, null given in vendor/magento/module-security/Model/AdminSessionInfo.php:136»?

19.3.

Magento 2.4.7-p2 already implements my patch.
So, I just replaced my modified file with the file from 2.4.7-p2, and removed the file from my Git repository: