Skip to content

Fatal error on Product-Compare page when Short Description & Description attributes are empty #28254

@operator888

Description

@operator888

magento2-3-5-dev-bug t23dev-2020 05 17-21-40-01 (1)

Preconditions (*)

  1. Magento 2.3.5

Steps to reproduce (*)

  1. Add products to Compare where at least one product has no value set for at least one of its comparable attributes (e.g. "Description" or "Short Description" is empty).
  2. Go to the compare page (<site_root>/catalog/product_compare/index)

Expected result (*)

  1. Compare page should load normally, where any unconfigured attributes show "N/A" or "No".

Actual result (*)

  1. Compare page is Broken and a Fatal Error is displayed.
    Fatal error: Uncaught TypeError: preg_match() expects parameter 2 to be string, object given in /app/web/vendor/magento/module-catalog/Helper/Output.php:245

Fatal error: Uncaught TypeError: preg_match() expects parameter 2 to be string, object given in /app/web/vendor/magento/module-catalog/Helper/Output.php:245 Stack trace: #0 /app/web/vendor/magento/module-catalog/Helper/Output.php(245): preg_match('/{{([a-z]{0,10}...', Object(Magento\Framework\Phrase)) #1 /app/web/vendor/magento/module-catalog/Helper/Output.php(185): Magento\Catalog\Helper\Output->isDirectivesExists(Object(Magento\Framework\Phrase)) #2 /app/web/vendor/magento/module-catalog/view/frontend/templates/product/compare/list.phtml(134): Magento\Catalog\Helper\Output->productAttribute(Object(Magento\Catalog\Model\Product\Interceptor), Object(Magento\Framework\Phrase), 'short_descripti...') #3 /app/web/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/app/web/vendor...') #4 /app/web/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\Compare\ListCompare\Interceptor), '/app/web/vendor...', Array) #5 /app/w in /app/web/vendor/magento/module-catalog/Helper/Output.php on line 245

Metadata

Metadata

Labels

Component: CatalogIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReported on 2.3.5Indicates original Magento version for the Issue report.Reproduced on 2.3.5p1Only if reproduced on 2.3.5p1 but not on 2.4-develop

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions