Skip to content

SQL query is printed into browser in case of exception #13385

@alexkuk

Description

@alexkuk

Preconditions

  1. Magento 2.2.2. Was reproduced on Magento 2.1.9 as well.
  2. Production mode
  3. Reproduced on EAV collections

Steps to reproduce

  1. Add an erroneous SQL statement to collection select object. I've added this code to \Magento\Catalog\Block\Product\ListProduct::initializeProductCollection():
$collection = $layer->getProductCollection();
$collection->getSelect()->columns('qwerty');

as an example
2. Open some category page in a browser.

Expected result

  1. No SQL query is printed in a browser

Actual result

  1. SQL query is printed in a browser

Fix proposal

In the \Magento\Eav\Model\Entity\Collection\AbstractCollection::_loadEntities() replace $this->printLogQuery(true, true, $query); with $this->printLogQuery(false, true, $query);

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: 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 developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions