Open farhanramliwowshop opened 1 year ago
Hi @farhanramliwowshop. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
It's reproducible in 2.4.5-p5. The root cause is getResultingIds()
of https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Review/Model/ResourceModel/Review/Product/Collection.php. It resets the query to pull all reviews from database and then utilize the results to build edit link.
My workaround is to create a patch to update it like below.
$data = $this->getConnection() ->fetchAll( $idsSelect ->columns('rt.review_id') );
Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hello @farhanramliwowshop,
Thank you for the report and collaboration!
We were able to verify this issue on 2.4-develop. We used your script to add the reviews. In our case the admin page was getting logged out when refreshing the reviews page for 14,500 reviews, with the below error.
[2023-11-30T08:39:16.082220+00:00] main.WARNING: Session size of 276374 exceeded allowed session max size of 256000. [] []
Hence confirming the issue.
Thank you.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-10627 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi @qlhu, I am able to implement the fix using the code given by you, thank you so much, my test so far on my local environment is working, will update if encountered this issue on other environment
Product attribute also affected(huge amount of the options) To debug, put the conditional breakpoint at vendor/magento/framework/Session/SessionManager.php:151 with condition
strpos(strtolower($method), 'set') !==false
This is only produced if you have an exception during the save attribute
Preconditions and environment
require DIR . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $appState = $objectManager->get('Magento\Framework\App\State'); $appState->setAreaCode('frontend');
$reviewFactory = $objectManager->get(ReviewFactory::class); $ratingFactory = $objectManager->get(RatingFactory::class); $productFactory = $objectManager->get(ProductFactory::class); $resource = $objectManager->get(ResourceConnection::class);
// Get a random product ID $productIds = $productFactory->create()->getCollection()->getAllIds(); $productId = $productIds[array_rand($productIds)];
// Get a random customer ID $customerIds = $objectManager->create('Magento\Customer\Model\Customer')->getCollection()->getAllIds(); $customerId = $customerIds[array_rand($customerIds)];
$randValue = rand(1, 99999999999999);
// Create a random review title and detail $randomTitle = "Review Title " . $randValue; $randomDetail = "Review Detail " . $randValue; $randomNickname = "Farhan " . $randValue;
// Create a review $review = $reviewFactory->create(); $review->setEntityPkValue($productId); $review->setStatusId(\Magento\Review\Model\Review::STATUS_APPROVED); $review->setTitle($randomTitle); $review->setDetail($randomDetail); $review->setEntityId(1); // 1 corresponds to the product entity type $review->setStoreId(1); // Replace with your store ID $review->setStores([1]); // Replace with your store IDs
// Assign random ratings $ratings = [ 'quality' => rand(1, 5), 'price' => rand(1, 5), 'value' => rand(1, 5), ]; $review->setRatings($ratings);
$review->setCustomerId($customerId); $review->setNickname($randomNickname); $review->save();
echo "Review added successfully.\n";
[2023-11-17T08:08:26.832487+00:00] report.WARNING: Session size of 2413109 exceeded allowed session max size of 256000. [] []