Nuranto

Nuranto

Member Since 9 years ago

1985, France

Experience Points
1
follower
Lessons Completed
8
follow
Lessons Completed
32
stars
Best Reply Awards
17
repos

32 contributions in the last year

Pinned
⚡ SDK PHP for Mangopay API v2
⚡ All Submissions you make to Magento Inc. (“Magento") through GitHub are subject to the following terms and conditions: (1) You grant Magento a perpetual, worldwide, non-exclusive, no charge, royalty free, irrevocable license under your applicable copyrights and patents to reproduce, prepare derivative works of, display, publically perform, sublicense and distribute any feedback, ideas, code, or other information (“Submission") you submit through GitHub. (2) Your Submission is an original work of authorship and you are the owner or are legally entitled to grant the license stated above. (3) You agree to the Contributor License Agreement found here: https://github.com/magento/magento2/blob/master/CONTRIBUTOR_LICENSE_AGREEMENT.html
⚡ Laravel Countries is a bundle for Laravel, providing Almost ISO 3166_2, 3166_3, currency, Capital and more for all countries.
⚡ A HTTP2 SeverPush Middleware for Laravel 5
⚡ Laravel 5 Javascript Validation
⚡ Visual javascript editor for the bootstrap 4 grid system, written as a jQuery plugin.
Activity
Oct
14
2 days ago
Activity icon
issue

Nuranto issue mageplaza/magento-2-smtp

Nuranto
Nuranto

UTF-8 issue - Invalid header value detected

Preconditions (*)

Reproduced on Magento 2.4.3-p1 and SMTP 4.6.1 Also reproduced on Magento 2.4.2-p1 and SMTP 4.5.2

Steps to reproduce (*)

  1. Enable Mageplaza_Smtp (It works fine when Mageplaza_Smtp is disabled)
  2. Create a customer with a 'é' in firstname (It works fine without special chars)
  3. On customer backend page, click on reset password

Expected result (*)

  1. Email is sent to customer

Actual result (*)

  1. Error Invalid header value detected
[2021-10-14 15:48:40] main.CRITICAL: Exception message: Invalid header value detected
Trace: <pre>#1 Laminas\Mail\Header\AbstractAddressList->getFieldValue() called at [vendor/laminas/laminas-mail/src/Header/AbstractAddressList.php:212]
#2 Laminas\Mail\Header\AbstractAddressList->toString() called at [vendor/laminas/laminas-mail/src/Headers.php:490]
#3 Laminas\Mail\Headers->toString() called at [vendor/laminas/laminas-mail/src/Message.php:549]
#4 Laminas\Mail\Message->toString() called at [vendor/mageplaza/module-email-attachments/Mail/EmailMessage.php:245]
#5 Mageplaza\EmailAttachments\Mail\EmailMessage->toString() called at [vendor/mageplaza/module-email-attachments/Mail/EmailMessage.php:237]
#6 Mageplaza\EmailAttachments\Mail\EmailMessage->getRawMessage() called at [vendor/mageplaza/module-smtp/Mail/Transport.php:115]
#7 Mageplaza\Smtp\Mail\Transport->aroundSendMessage() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#8 Mageplaza\EmailAttachments\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/dotmailer/dotmailer-magento2-extension/Plugin/TransportPlugin.php:97]
#9 Dotdigitalgroup\Email\Plugin\TransportPlugin->aroundSendMessage() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#10 Mageplaza\EmailAttachments\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/module-email/Model/Mail/TransportInterfacePlugin.php:48]
#11 Magento\Email\Model\Mail\TransportInterfacePlugin->aroundSendMessage() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#12 Mageplaza\EmailAttachments\Mail\Transport\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#13 Mageplaza\EmailAttachments\Mail\Transport\Interceptor->___callPlugins() called at [generated/code/Mageplaza/EmailAttachments/Mail/Transport/Interceptor.php:23]
#14 Mageplaza\EmailAttachments\Mail\Transport\Interceptor->sendMessage() called at [vendor/magento/module-customer/Model/EmailNotification.php:277]

(log from M2.4.2-p1 / SMTP 4.5.2)

Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Magento 2.3.5-p2 issue on sending email with Chinese Sender Name "Invalid header value detected"

Summary (*) When a customer or user wants to change its password in his dashboard password change option. If the Store Email Addresses configuration (Admin->stores->settings->configurations->general->Store Email Addresses->Customer Support->Sender Name) is set in Chinese e-g "蘭芝台灣" and save configuration. In this scenario email is not sending and shows the error "Invalid header value detected".

Preconditions (*)

  1. Magento 2.3.5-p2
  2. Sender name in configuration is set in Chinese.

Steps to reproduce (*)

  1. In Admin Panel navigate to (Admin->stores->settings->configurations->general->Store Email Addresses->Customer Support->Sender Name).
  2. Add Sender Name in Chinese e-g "蘭芝台灣" and save configuration
  3. Login at website then navigate to My Account->Change Password and click on change password and add new password

Expected result (*)

  1. Email should be send to the user when he changed the password.

Actual result (*)

  1. Email is not received by the user and shows the error flash message "Invalid header value detected"

Further Details(*) Video recording of this issue

Nuranto
Nuranto

I just reproduced this issue on 2.4.3-p1, but not with UTF-8 in sender name, but in receiver name

Activity icon
issue

Nuranto issue Smile-SA/elasticsuite

Nuranto
Nuranto

Displaying unrelated products on category page

Preconditions

Magento Version : 2.4.2

ElasticSuite Version : 2.10.6

Environment : Production

Steps to reproduce

  1. Create category "Main"
  2. Create subcategory "Main > Main red", virtual category with rules = "Category = Main and Color = red"

Expected result

  1. Main category shows products from Main category

Actual result

  1. Main category shows products from Main category AND any red products
Oct
4
1 week ago
Activity icon
issue

Nuranto issue magento/magento2

Nuranto
Nuranto

Unit Test Case Failing in Magento 2.4.3

After migrating from 2.4.2 :

There was 1 error:
1) PayPal\Braintree\Test\Unit\Gateway\Request\AddressDataBuilderTest::testBuild with data set #0 (array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', 'US', '00000'), array(array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US'), array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US')))
Error: Call to undefined method Mock_AddressAdapterInterface_c9a980a9::getStreet()
/var/www/html/vendor/paypal/module-braintree-core/Gateway/Request/AddressDataBuilder.php:102
/var/www/html/vendor/paypal/module-braintree-core/Test/Unit/Gateway/Request/AddressDataBuilderTest.php:121

Seems @Den4ik reproduced it too (see #33861)

Sep
28
2 weeks ago
Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Unit Test Case Failing in Magento 2.4.3

After migrating from 2.4.2 :

There was 1 error:
1) PayPal\Braintree\Test\Unit\Gateway\Request\AddressDataBuilderTest::testBuild with data set #0 (array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', 'US', '00000'), array(array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US'), array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US')))
Error: Call to undefined method Mock_AddressAdapterInterface_c9a980a9::getStreet()
/var/www/html/vendor/paypal/module-braintree-core/Gateway/Request/AddressDataBuilder.php:102
/var/www/html/vendor/paypal/module-braintree-core/Test/Unit/Gateway/Request/AddressDataBuilderTest.php:121

Seems @Den4ik reproduced it too (see #33861)

Nuranto
Nuranto

It seems it has already been fixed in original library : https://github.com/genecommerce/module-braintree-magento2/pull/176

So it just needs to be merged in magento's fork.

Sep
27
2 weeks ago
Activity icon
issue

Nuranto issue proengsoft/laravel-jsvalidation

Nuranto
Nuranto

Validation issue with arrays

Subject of the issue

Rule does not work on array when using variable in rule.

Your environment

  • version of this package: Latest
  • version of Laravel: 8

Steps to reproduce

Example :

Rule :

'item.*.name' => 'required_unless:item.*.delete,1|string',

Expected behaviour

name shoud be required on rows where delete field is 0 name shoud be optionnal on rows where delete field is 1

Actual behaviour

name is always required

Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Declarative schema bug : default value cannot be negative on signed int

Preconditions (*)

Magento 2.4.1

Steps to reproduce (*)

Create a table with thoses columns :

<column xsi:type="int" name="some_name" unsigned="false" nullable="false" identity="false" default="-1" comment="Some Name"/>

Note that unsigned is set to false.

Expected result (*)

Table is created

Actual result (*)

Element 'column', attribute 'default': [facet 'pattern'] The value '-1' is not accepted by the pattern '\d+|null'.

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround. (When migrating from M1 for instance)
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Nuranto
Nuranto

I still reproduce this bug on 2.4.3.

I don't know why you cannot reproduce, but let's look at xsd : for int, src/vendor/magento/framework/Setup/Declaration/Schema/etc/types/integers/integer.xsd applies, and the regex is \d+|null which does not accepts negative values. It should be -?\d+|null, right ?

If you can't reproduce, maybe something in your configuration makes the validation to be skipped ? Or maybe regex has different behaviour regarding PHP or libxml version ? ( mine : PHP 7.4.19, libxml Version => 2.9.4 )

Activity icon
issue

Nuranto issue dompdf/dompdf

Nuranto
Nuranto

TypeError : Unsupported operand types: float + string

Capture d’écran 2021-09-27 à 12 03 11

Activity icon
issue

Nuranto issue magento/magento2

Nuranto
Nuranto

Unit Test Case Failing in Magento 2.4.3

After migrating from 2.4.2 :

There was 1 error:
1) PayPal\Braintree\Test\Unit\Gateway\Request\AddressDataBuilderTest::testBuild with data set #0 (array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', 'US', '00000'), array(array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US'), array('John', 'Smith', 'Magento', 'street1', 'street2', 'Chicago', 'IL', '00000', 'US')))
Error: Call to undefined method Mock_AddressAdapterInterface_c9a980a9::getStreet()
/var/www/html/vendor/paypal/module-braintree-core/Gateway/Request/AddressDataBuilder.php:102
/var/www/html/vendor/paypal/module-braintree-core/Test/Unit/Gateway/Request/AddressDataBuilderTest.php:121

Seems @Den4ik reproduced it too (see #33861)

Sep
23
3 weeks ago
open pull request

Nuranto wants to merge magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
Nuranto
Nuranto

@slopukhov I see you're the one who made that change (a long time ago ^^).. Maybe you have an opinion on this and a better solution that the one I proposed ?

pull request

Nuranto merge to magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
pull request

Nuranto merge to magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
open pull request

Nuranto wants to merge magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
Nuranto
Nuranto

That's what I tried first. But as I was trying to explain, getProductsCountQuery (which is supposed to fill $categoryProductsCount) try to get data from catalog_category_product_index, which is an obsolete table which stays empty... That table has been replaced by catalog_category_product_index_storeX, leaving no more general index table for admin...

If you keep only the change in Collection class, so the variable rename, and using $tableMaintainer in getProductsCountQuery method, then we'll have a partial fix that solves the issue when user selects a store view in backend category page. But the issue will remains on default view. That's why I added mechanics for catalog_category_product_index_store0...

Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
Nuranto
Nuranto

@orlangur I'm sure it was intended. However when they did, they forgot about category backend page.

My changes in app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php confirms that. That code was totally unused as it was. (wrong variable name, and even if it was correct, it was looking into the deprecated catalog_category_product_index table => that's the reason of other changes.).

Before my changes, it went through getProductsCountFromCategoryTable for each category. So 1 sql query for each. In my case, that's 7 780 requests that could be avoided, for one single page load... One of these SQL request was around 0.25ms, so almost 2s gain on TTFB...

However, those time were calculated on local environment, so the gain is probably a bit less on production environments.

In any case, even if you don't want to add index on admin store, the code app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php still needs to be adapted accordingly..

I'll leave it into your hands

Sep
21
3 weeks ago
push

Nuranto push webcooking/magento2

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Conflicts:

app/code/Magento/GraphQl/composer.json

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add logging support for GraphQL queries
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • adjust implementation
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • pull query analysis into helper, add tests
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • test updates
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add tests
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • improve naming
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • move logging to after response is created
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Conflicts: app/code/Magento/GraphQl/composer.json

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add logging of http response code
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • fix test failures
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • remove logging for introspection queries
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

commit sha: d70cf74f060c2c40748216150205201efb7d5eba

push time in 3 weeks ago
push

Nuranto push webcooking/magento2

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Conflicts:

app/code/Magento/GraphQl/composer.json

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add logging support for GraphQL queries
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • adjust implementation
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • pull query analysis into helper, add tests
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • test updates
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add tests
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • improve naming
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • move logging to after response is created
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

Conflicts: app/code/Magento/GraphQl/composer.json

Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • add logging of http response code
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • fix test failures
Nuranto
Nuranto

PWA-1311: New Relic is not being given useful transaction names for graphql requests

  • remove logging for introspection queries
Nuranto
Nuranto

Merge remote-tracking branch 'origin/2.4-develop' into PWA-1311

commit sha: 1483c7a45ca1c2e82302353078b672610fc3c524

push time in 3 weeks ago
Sep
17
4 weeks ago
pull request

Nuranto merge to magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
open pull request

Nuranto wants to merge magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
Nuranto
Nuranto

I thought like was faster than regex ?!

Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
pull request

Nuranto pull request magento/magento2

Nuranto
Nuranto

Backend category performance fix

Description (*)

  • Add product-category index table for default store (used for backend category page - product count)
  • Use index table in backend category page for product count

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#34109

Manual testing scenarios (*)

  1. Measure time (or count SQL requests, in my case 14K+) of /admin/catalog/category/ and /admin/catalog/category/store/X pages
  2. Pull changees
  3. Reindex catalog_category_product
  4. Measure again (or count again, in my care 7K~)

Questions or comments

To make the change work on default store (admin store), I had to enable reindexing catalog_product_category on default store. Which mean there is a new table created and indexed : catalog_category_product_index_store0 (and catalog_category_product_index_store0_replica)

In Collection class, you see I use ObjectManager instead of passing class through constructor. I did that to avoid break classes that could extends this one (third par modules). But if you want, I can change that, I don't know what your policy is about that.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)
Activity icon
created branch

Nuranto in webcooking/magento2 create branch 34109

createdAt 4 weeks ago
Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Bug on category count (performance issue)

In src/vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php

Line 330-333 :

                $productsCount = isset($categoriesProductsCount[$item->getId()])
                    ? (int)$categoryProductsCount[$item->getId()]
                    : $this->getProductsCountFromCategoryTable($item, $websiteId);

should be

                $productsCount = isset($categoryProductsCount[$item->getId()])
                    ? (int)$categoryProductsCount[$item->getId()]
                    : $this->getProductsCountFromCategoryTable($item, $websiteId);

( categoriesProductsCount instead of categoryProductsCount )

This is causing performance issue on backend category page especially when having a big amount of categories/products.

Nuranto
Nuranto

There is nothing to reproduce since it is just a performance issue.

Actually, I did more tests and it seems the table catalog_category_product_index is used for fetching pairs, but that table seems deprecated, so that fix doesn't fix performance issue after all by its own. It's quite difficult to use it since there is no index for admin store. But I will make a PR for this.

push

Nuranto push webcooking/magento2

Nuranto
Nuranto

33207: Removed lib/web/MutationObserver.js and replaced usages with native JS MutationObserver

Nuranto
Nuranto

33206: Removed lib/web/es6-collections.js and replaced usages with native JS

Nuranto
Nuranto

MC-42008: Problem with customer API route

Nuranto
Nuranto

MC-42008: Problem with customer API route

Nuranto
Nuranto

Refactoring of dependencies & mocking object

Nuranto
Nuranto

AC-251: Create new Data patch

Nuranto
Nuranto

Merge remote-tracking branch 'mainline/2.4-develop' into AC-229

Nuranto
Nuranto

Merge remote-tracking branch 'trigger/AC-229' into AC-251

Nuranto
Nuranto

AC-251: Create new Data patch

Nuranto
Nuranto

Merge remote-tracking branch 'mainline/2.4-develop' into AC-229

Nuranto
Nuranto

Merge remote-tracking branch 'trigger/AC-229' into AC-251

Nuranto
Nuranto

MC-42506: [CLOUD] duplicated product does not retain some store view specific data

  • fixed
  • removed redundant unit test
  • added integration test
Nuranto
Nuranto

Remove usage of laminas\mvc from Setup Wizard page

Nuranto
Nuranto

MC-42249: No form validation for negative quantity on bundle products

  • Added the validation for quantity text box in product detail page for bundle products.
Nuranto
Nuranto

AC-229: Upgrade and remove tinymce4

  • update composer lock
Nuranto
Nuranto

Merge remote-tracking branch 'trigger/AC-229' into AC-251

Nuranto
Nuranto

MC-42249: No form validation for negative quantity on bundle products

  • Restricted the price calculation on change of quantiy textbox in bundle products.
Nuranto
Nuranto

Merge remote-tracking branch 'mainline/2.4-develop' into AC-252

Nuranto
Nuranto

AC-251: Create new Data patch

  • move data patch to the Config module
Nuranto
Nuranto

AC-86: Update language for data collection opt-in messaging for 2.4.4

  • Updated opt-in text

commit sha: 5734ca9f5e6d11256019831ee27903ab9e8045a0

push time in 4 weeks ago
Activity icon
issue

Nuranto issue magento/magento2

Nuranto
Nuranto

Bug on category count (performance issue)

In src/vendor/magento/module-catalog/Model/ResourceModel/Category/Collection.php

Line 330-333 :

                $productsCount = isset($categoriesProductsCount[$item->getId()])
                    ? (int)$categoryProductsCount[$item->getId()]
                    : $this->getProductsCountFromCategoryTable($item, $websiteId);

should be

                $productsCount = isset($categoryProductsCount[$item->getId()])
                    ? (int)$categoryProductsCount[$item->getId()]
                    : $this->getProductsCountFromCategoryTable($item, $websiteId);

( categoriesProductsCount instead of categoryProductsCount )

This cause performance issue on backend category page especially when having a big amount of categories/products.

Sep
7
1 month ago
Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

Reset password email sent from wrong store

Preconditions (*)

  1. Magento >= 2.3.4 (tested on Magento 2.3.4)

Steps to reproduce (*)

  1. Login to Magento Backend
  2. Go to Stores > All Stores and create a new website and a new store associated to that website
  3. Go to Stores > Configuration > General > Web and use a different domain for the new website
  4. Go to Stores > Configuration > General > General > Locale Options and set the new store's language to a different one from the default store
  5. Go to Stores > Configuration > Customers > Customer Configuration > Account Sharing Options and enable account sharing
  6. Go to Magento Store Frontend in the first (default) store
  7. Create a customer account
  8. Go to the second store
  9. Go to the forgot password page and send the form using the email used in step 6 (create a customer account)

Expected result (*)

  1. Customer receives an email sent in the correct language
  2. Customer gets redirected to the login page of the second store view
  3. The URL in the footer is the one of the second store view

Actual result (*)

  1. Customer receives an email sent in the language of the store he created his account in
  2. Customer gets redirected to the login page of the store he created his account in
  3. The URL in the footer is the one of the store he created his account in

Explanation

The bug seems to have appeared in Magento 2.3.4 after changing the method \Magento\Customer\Model\EmailNotification::passwordResetConfirmation.

Before Magento 2.3.4, the code did this:

    public function passwordResetConfirmation(CustomerInterface $customer)
    {
        $storeId = $this->storeManager->getStore()->getId();
        if (!$storeId) {
            $storeId = $this->getWebsiteStoreId($customer);
        }

        $customerEmailData = $this->getFullCustomerObject($customer);

        $this->sendEmailTemplate(
            $customer,
            self::XML_PATH_FORGOT_EMAIL_TEMPLATE,
            self::XML_PATH_FORGOT_EMAIL_IDENTITY,
            ['customer' => $customerEmailData, 'store' => $this->storeManager->getStore($storeId)],
            $storeId
        );
    }

but was changed to this:

    public function passwordResetConfirmation(CustomerInterface $customer)
    {
        $storeId = $customer->getStoreId();
        if (!$storeId) {
            $storeId = $this->getWebsiteStoreId($customer);
        }

        $customerEmailData = $this->getFullCustomerObject($customer);

        $this->sendEmailTemplate(
            $customer,
            self::XML_PATH_FORGOT_EMAIL_TEMPLATE,
            self::XML_PATH_FORGOT_EMAIL_IDENTITY,
            ['customer' => $customerEmailData, 'store' => $this->storeManager->getStore($storeId)],
            $storeId
        );
    }

The problem si that the customer's store ID is retrieved instead of the current store ID.

I think the issue was introduced in this GitHub issue: https://github.com/magento/magento2/issues/5726 which clearly didn't take into account the multi-website / multi-domain and frontend email.

Nuranto
Nuranto

I have the same issue for user created from admin. They have store_id = 0, website_id = 7. So the store_id does not work.

The behavior of having store_id = 0 when created from admin is actually a M1 bug, so the issue is on data migration tool. A simple fix for that is to update store_id in customer table.

Hope it helps.

Aug
28
1 month ago
Activity icon
issue

Nuranto issue comment dompdf/dompdf

Nuranto
Nuranto

pagebreak with table rowspan not created correctly

I have a table with merged cells in several rows, but when I use dompdf and performs a page break, the cells are not created correctly.

How can I correct it? Thanks.

Table: https://jsfiddle.net/shinseiki86/24LL3fd5/

Result: image

Nuranto
Nuranto

I confirm this issue is still present in last 1.0.2 version

Aug
27
1 month ago
Aug
9
2 months ago
Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

LoginAsCustomer leaves admin backend unaccessible in multidomain-setup

I confirm issue https://github.com/magento/magento2/issues/32796 :

Preconditions (*)

  1. Magento 2.4.2

Steps to reproduce (*)

  1. Create a multi store, multi domain setup, for example

Domain StoreView test1.test de_DE test2.test en_US

  1. Configure Magento such as the StoreView must not be part of the url
  2. Configure the backend such as it is available under one of these domains, eg test2.test/admin
  3. Create a customer each for both StoreViews
  4. Login to the backend and configure the customers so that both can be accessed with the "LoginAsCustomer" feature
  5. From the backend login as customer which is assigned to a StoreView on another domain as the backend (eg test1.test)
  6. Close the frontend session
  7. Hit Refresh in the browser for the backend

Expected result (*)

  1. the backend reloads and can be used

Actual result (*)

  1. the backend hits - depending on the system configuration - either a redirection loop of death or a plain text site without any style or javascript loaded

Workaround

The backend can be made accessible again by deleting a cookie named "store", which contains the StoreView of the customer.

The problem lies in

https://github.com/magento/magento2/blob/f25fc0398899c2bc126bc877d4147aeea377af64/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php#L250

        if (!$targetStore->isUseStoreInUrl()) {
            $fromStore = $this->storeManager->getStore();
            $redirectUrl = $this->manageStoreCookie->switch($fromStore, $targetStore, $redirectUrl);
        }

The immediate workaround is a patch to change the condition as follows

        if (!$targetStore->isUseStoreInUrl() && $targetStore->getBaseUrl() === $this->_url->getBaseUrl()) {
            $fromStore = $this->storeManager->getStore();
            $redirectUrl = $this->manageStoreCookie->switch($fromStore, $targetStore, $redirectUrl);
        }

This workaround does it's thing for our use case, but there is no warranty it will work in yours

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Nuranto
Nuranto

I did not find a way to reproduce on a fresh install yet. My best guess atm is that there is something to do with filling URL settings via environment variables instead of database. But I already spent too much time on this one.

But I found the cause of the issue.

If I debug Magento\Backend\App\Area\FrontNameResolver::isHostBackend() like this, from a backend call

$backendUrl /* orig */ = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE);
            $backendUrlTestStoreAdmin = $this->scopeConfig->getValue(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE, 0);
            var_dump($backendUrl, $backendUrlTestStoreAdmin);

I get Second store URL in $backendUrl, and Backend domain URL in $backendUrlTestStoreAdmin...

So there's an issue in the scope resolver when you don't provide the scopeCode. I don't know where exactly the bug is.

A quick fix could be to specify 0 store id like I did above. It will fix that issue, and it will be better for performances (no more resolving).

A solution, while it is not fixed, if someone else has this issue, is to use admin custom_url and custom path fields.

Activity icon
issue

Nuranto issue comment magento/magento2

Nuranto
Nuranto

LoginAsCustomer leaves admin backend unaccessible in multidomain-setup

I confirm issue https://github.com/magento/magento2/issues/32796 :

Preconditions (*)

  1. Magento 2.4.2

Steps to reproduce (*)

  1. Create a multi store, multi domain setup, for example

Domain StoreView test1.test de_DE test2.test en_US

  1. Configure Magento such as the StoreView must not be part of the url
  2. Configure the backend such as it is available under one of these domains, eg test2.test/admin
  3. Create a customer each for both StoreViews
  4. Login to the backend and configure the customers so that both can be accessed with the "LoginAsCustomer" feature
  5. From the backend login as customer which is assigned to a StoreView on another domain as the backend (eg test1.test)
  6. Close the frontend session
  7. Hit Refresh in the browser for the backend

Expected result (*)

  1. the backend reloads and can be used

Actual result (*)

  1. the backend hits - depending on the system configuration - either a redirection loop of death or a plain text site without any style or javascript loaded

Workaround

The backend can be made accessible again by deleting a cookie named "store", which contains the StoreView of the customer.

The problem lies in

https://github.com/magento/magento2/blob/f25fc0398899c2bc126bc877d4147aeea377af64/app/code/Magento/LoginAsCustomerAdminUi/Controller/Adminhtml/Login/Login.php#L250

        if (!$targetStore->isUseStoreInUrl()) {
            $fromStore = $this->storeManager->getStore();
            $redirectUrl = $this->manageStoreCookie->switch($fromStore, $targetStore, $redirectUrl);
        }

The immediate workaround is a patch to change the condition as follows

        if (!$targetStore->isUseStoreInUrl() && $targetStore->getBaseUrl() === $this->_url->getBaseUrl()) {
            $fromStore = $this->storeManager->getStore();
            $redirectUrl = $this->manageStoreCookie->switch($fromStore, $targetStore, $redirectUrl);
        }

This workaround does it's thing for our use case, but there is no warranty it will work in yours

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Nuranto
Nuranto
Jul
27
2 months ago
Activity icon
created tag
createdAt 2 months ago
Previous