-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest laminas/laminas-escaper (2.7.0 -> 2.7.1) breaks product and catalog category view pages #33346
Comments
Hi @msyhr. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
I also have the same issue, was quite striking since yesterday I didn't find this issue while updating composer.json |
Currently there is an error in laminas-escaper. You can add the following to your composer.json and run composer update. This is only a temporary fix for this problem. |
i can also reproduced with latest code base magento + laminas/laminas-escaper 2.7.1 + Sample data contain review data product. Category page will break with similar error |
I also spent a few hours yesterday troubleshooting after installing 2.4.2p1. Sorry but you are making it a little too easy to blame laminas-escaper.
The lib doesn't even enforce this type, but by enabling type checking it now impacts the function rawurlencode used in this function. Und URL-Encode ist PHP Standard.
Activating the type check is not a mistake and I don't think they will take it back. All values are passed from Magento to the function unchecked, regardless of whether they are a string or not. |
This is also the solution I am using, downgrading the version back to 2.7.0. This is not only happening for Magento 2.4.2, but also Magento 2.4.2-p1 as well as 2.3.6. I believed all versions of Magento 2 using laminas are affected. This error pages also only affect pages with a product grid and product detail page (If I am correct, if review ratings are loaded within the page). |
Just as an FYI for those affected by this issue. I've also had this happen on 2.3.7 |
I am facing the same bug at Magento 2.4.2-p1. Please fix immediately! |
I can confirm laminas-escaper 2.7.1 breaks M2 in a clean install w/sample data for 2.3.7 as well as 2.4.2 My workaround... composer require "laminas/laminas-escaper:<2.7.0" |
Is this fixed with the latest Laminas Escaper release now? https://github.com/laminas/laminas-escaper/releases/tag/2.8.0 |
I see that a little bit different to blame magento for that... from the client it looks like a breaking change ... with a bugfix release. besides that ... i can live with forcing 2.7.0 until magento fixes the strict types. |
After executing composer update, the problem resolved. Thanks so much |
Confirmed, indeed upgrading |
i think upgrade laminas package is not enough. Magento also need patch from codebase too. |
@mrtuvn: I can't reproduce what you are saying, but I'm not using a vanilla installation at the moment. Can you add more detailed steps and maybe also a stacktrace for your case? |
I've retested on 2.3.7 and can confirm laminas escaper 2.8.0 resolves the issue. I'm using a set up with sample data installed, and cannot replicate the error that @mrtuvn indicates either. So more info will be required for that one |
I'm not sure but i have tested in my local dev (developer mode) with latest code base (no sample data) and upgraded laminas escaper to latest. Problem still be the same (without patch). Broken layout in details, category, admin(categories and product new entity page) |
@mrtuvn: do you have a stack trace? |
Ah, I just noticed that on That might explain it. This line is not part of 2.4.2-p1, so it only crashes on the So that line should be released together with #33353 when it is properly fixed. (/cc @fascinosum ) |
I have a lot of this issue in system.log but not sure that is related. I can not how to reproduce it. [2021-06-28 11:59:14] main.CRITICAL: TypeError: html_entity_decode() expects parameter 1 to be string, null given in /var/www/html/vendor/magento/framework/Escaper.php:366 |
Yes...I got the same issue in admin Catalog -> Categories or Catalog -> product -> Clic on one product you should get same issue on M2.4.2 |
FYI if you're using 2.4.2.-p1, hard locking the laminas-escaper lib to 2.7.0 is probably going to be your only option for now. |
Preconditions (*)
Install 2.4.2-p1 or run composer-update on an existing install that hasn't been run in hours since 2.7.1 was release.
Steps to reproduce (*)
View any page with callout for
<?= $block->getReviewsSummaryHtml($_product, $templateType) ?>
Might be more widespread than this, but this is how I noticed it.
Happened on a client's instance, thought it might be related to one of their many 3rd party extensions. Quickly installed a blank 2.4.2-p1 instance w/sample data. Saw the result
Expected result (*)
Page loads
Actual result (*)
Partial page load with stack trace output
TypeError: rawurlencode() expects parameter 1 to be string, bool given in /shared/httpd/242test/htdocs/vendor/laminas/laminas-escaper/src/Escaper.php:246 Stack trace: #0 /shared/httpd/242test/htdocs/vendor/laminas/laminas-escaper/src/Escaper.php(246): rawurlencode(true) #1 /shared/httpd/242test/htdocs/vendor/magento/framework/Escaper.php(286): Laminas\Escaper\Escaper->escapeUrl(true) #2 /shared/httpd/242test/htdocs/vendor/magento/framework/Url/RouteParamsResolver.php(115): Magento\Framework\Escaper->encodeUrlParam(true) #3 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\Url\RouteParamsResolver->setRouteParams(Array, false) #4 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Url\RouteParamsResolver\Interceptor->___callParent('setRouteParams', Array) #5 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\Url\RouteParamsResolver\Interceptor->Magento\Framework\Interception\{closure}(Array, false) #6 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/Url/RouteParamsResolver/Interceptor.php(23): Magento\Framework\Url\RouteParamsResolver\Interceptor->___callPlugins('setRouteParams', Array, Array) #7 /shared/httpd/242test/htdocs/vendor/magento/framework/Url.php(716): Magento\Framework\Url\RouteParamsResolver\Interceptor->setRouteParams(Array, false) #8 /shared/httpd/242test/htdocs/vendor/magento/framework/Url.php(747): Magento\Framework\Url->_setRouteParams(Array, false) #9 /shared/httpd/242test/htdocs/vendor/magento/framework/Url.php(929): Magento\Framework\Url->getRouteUrl('', Array) #10 /shared/httpd/242test/htdocs/vendor/magento/framework/Url.php(873): Magento\Framework\Url->createUrl('', Array) #11 /shared/httpd/242test/htdocs/vendor/magento/module-catalog/Model/Product/Url.php(199): Magento\Framework\Url->getUrl('', Array) #12 /shared/httpd/242test/htdocs/vendor/magento/module-review/Block/Product/ReviewRenderer.php(149): Magento\Catalog\Model\Product\Url->getUrl(Object(Magento\Catalog\Model\Product\Interceptor), Array) #13 /shared/httpd/242test/htdocs/generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php(59): Magento\Review\Block\Product\ReviewRenderer->getReviewsUrl(false) #14 /shared/httpd/242test/htdocs/vendor/magento/module-review/view/frontend/templates/helper/summary.phtml(12): Magento\Review\Block\Product\ReviewRenderer\Interceptor->getReviewsUrl() #15 /shared/httpd/242test/htdocs/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/shared/httpd/2...') #16 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Review\Block\Product\ReviewRenderer\Interceptor), '/shared/httpd/2...', Array) #17 /shared/httpd/242test/htdocs/generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php(122): Magento\Framework\View\Element\Template->fetchView('/shared/httpd/2...') #18 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/Template.php(303): Magento\Review\Block\Product\ReviewRenderer\Interceptor->fetchView('/shared/httpd/2...') #19 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #20 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(1115): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() #21 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(675): Magento\Framework\View\Element\AbstractBlock->_loadCache() #22 /shared/httpd/242test/htdocs/generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php(347): Magento\Framework\View\Element\AbstractBlock->toHtml() #23 /shared/httpd/242test/htdocs/vendor/magento/module-review/Block/Product/ReviewRenderer.php(111): Magento\Review\Block\Product\ReviewRenderer\Interceptor->toHtml() #24 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Review\Block\Product\ReviewRenderer->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), 'default', true) #25 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Review\Block\Product\ReviewRenderer\Interceptor->___callParent('getReviewsSumma...', Array) #26 /shared/httpd/242test/htdocs/vendor/yotpo/magento2-module-yotpo-reviews/Plugin/Review/Block/Product/ReviewRenderer.php(32): Magento\Review\Block\Product\ReviewRenderer\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Model\Product\Interceptor), false, true) #27 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(135): Yotpo\Yotpo\Plugin\Review\Block\Product\ReviewRenderer->aroundGetReviewsSummaryHtml(Object(Magento\Review\Block\Product\ReviewRenderer\Interceptor), Object(Closure), Object(Magento\Catalog\Model\Product\Interceptor), false, true) #28 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Review\Block\Product\ReviewRenderer\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Model\Product\Interceptor), false, true) #29 /shared/httpd/242test/htdocs/generated/code/Magento/Review/Block/Product/ReviewRenderer/Interceptor.php(32): Magento\Review\Block\Product\ReviewRenderer\Interceptor->___callPlugins('getReviewsSumma...', Array, NULL) #30 /shared/httpd/242test/htdocs/vendor/magento/module-catalog/Block/Product/AbstractProduct.php(221): Magento\Review\Block\Product\ReviewRenderer\Interceptor->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), false, true) #31 /shared/httpd/242test/htdocs/generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(176): Magento\Catalog\Block\Product\AbstractProduct->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), false, true) #32 /shared/httpd/242test/htdocs/vendor/magento/module-catalog/view/frontend/templates/product/view/review.phtml(8): Magento\Catalog\Block\Product\View\Interceptor->getReviewsSummaryHtml(Object(Magento\Catalog\Model\Product\Interceptor), false, true) #33 /shared/httpd/242test/htdocs/vendor/magento/framework/View/TemplateEngine/Php.php(71): include('/shared/httpd/2...') #34 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/Template.php(273): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\View\Interceptor), '/shared/httpd/2...', Array) #35 /shared/httpd/242test/htdocs/generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(383): Magento\Framework\View\Element\Template->fetchView('/shared/httpd/2...') #36 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/Template.php(303): Magento\Catalog\Block\Product\View\Interceptor->fetchView('/shared/httpd/2...') #37 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(1111): Magento\Framework\View\Element\Template->_toHtml() #38 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(1115): Magento\Framework\View\Element\AbstractBlock->Magento\Framework\View\Element\{closure}() #39 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Element/AbstractBlock.php(675): Magento\Framework\View\Element\AbstractBlock->_loadCache() #40 /shared/httpd/242test/htdocs/generated/code/Magento/Catalog/Block/Product/View/Interceptor.php(608): Magento\Framework\View\Element\AbstractBlock->toHtml() #41 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(578): Magento\Catalog\Block\Product\View\Interceptor->toHtml() #42 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(555): Magento\Framework\View\Layout->_renderBlock('product.info.re...') #43 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('product.info.re...') #44 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info.re...') #45 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('product.info.re...', false) #46 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('product.info.re...', false) #47 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('product.info.ma...', false) #48 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('product.info.ma...') #49 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('product.info.ma...') #50 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('product.info.ma...', false) #51 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('product.info.ma...', false) #52 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('content', false) #53 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('content') #54 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content') #55 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('content', false) #56 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('content', false) #57 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('main', false) #58 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('main') #59 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main') #60 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('main', false) #61 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('main', false) #62 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('columns', false) #63 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('columns') #64 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns') #65 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('columns', false) #66 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('columns', false) #67 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('main.content', false) #68 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('main.content') #69 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content') #70 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('main.content', false) #71 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('main.content', false) #72 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false) #73 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper') #74 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper') #75 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('page.wrapper', false) #76 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(606): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper', false) #77 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Layout->_renderContainer('root', false) #78 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(149): Magento\Framework\View\Layout->renderNonCachedElement('root') #79 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(510): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root') #80 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(140): Magento\Framework\View\Layout->renderElement('root', true) #81 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Layout.php(975): Magento\Framework\View\Layout\Interceptor->renderElement('root') #82 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput() #83 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array) #84 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}() #85 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Layout/Interceptor.php(347): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array) #86 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Result/Page.php(258): Magento\Framework\View\Layout\Interceptor->getOutput() #87 /shared/httpd/242test/htdocs/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor)) #88 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor)) #89 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array) #90 /shared/httpd/242test/htdocs/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor)) #91 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(95): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array) #92 /shared/httpd/242test/htdocs/vendor/magento/framework/App/Http.php(120): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor)) #93 /shared/httpd/242test/htdocs/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch() #94 /shared/httpd/242test/htdocs/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http\Interceptor->launch() #95 /shared/httpd/242test/htdocs/pub/index.php(29): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #96 {main}
Resolution (*)
Force composer to use 2.7.0 and reload page, page loads with no issues.
The text was updated successfully, but these errors were encountered: