View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006970 | OXID eShop (all versions) | 4. ------ eShop Core ------- | public | 2019-04-08 14:50 | 2024-06-12 16:07 |
Reporter | m4r73n | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Product Version | 6.1.2 | ||||
Summary | 0006970: Article->hasAmountPrice() returns the wrong result | ||||
Description | Article->hasAmountPrice() returns if there is *any* article in the shop that has an amount price defined. It should return if *this article* has an amount price defined. The reason is that there's a WHERE missing in the SQL query: $sQ = "SELECT 1 FROM `oxprice2article` LIMIT 1"; It should be: $sQ = "SELECT 1 FROM `oxprice2article` WHERE `oxartid` = '" . $this->getId() . "'LIMIT 1"; | ||||
Tags | Article, Solution Provided | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
@m4r73n: We can think of many cases where this would harm performance, but of no use case where this would help anything. This query should be very fast to resolve (it does only read the first line on the table no matter how big it is and not even the fields, so it also doesn't matter if it was blown up to many columns) and the result is cached within the Request. If we on the other hand add the current article to the query, it now instantly matters how big the table is. Since this is only a flag that tells the shop if it needs to read the actual data, this could only matter if you have few lines of this in the database. And at that point the query for the actual data should also be fast as the table is small anyway. If we are missing anything, please feel free to re-open the ticket with more information about what you are trying to achieve. |