View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006579 | OXID eShop (all versions) | 1.01. Products (product, categories, manufacturer, promotions etc.) | public | 2017-01-30 14:56 | 2017-09-07 10:03 |
Reporter | Spritje | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.10.4 / 5.3.4 | ||||
Fixed in Version | 4.10.6 / 5.3.6 | ||||
Summary | 0006579: Sorting by self-created fields in the oxarticles does not work | ||||
Description | If you add a field "oxcriteria" in oxarticles table and make it avaliable as sorting criteria in core settings -> settings -> products -> Database Fields Product Lists can be sorted after, sorting will not work. In oxubase::getUserSelectedSorting() the field name is checked. Because this array does not contain the new field in_array ($ sSortBy, oxNew ('oxArticle') -> getFieldNames (), the sort does not work. The array is stored serialized in tmp/oxeec_fieldnames_oxarticles_alist_i18n.txt Workaround: manually enter the field "oxcriteria" into this file. | ||||
Steps To Reproduce | 1. create field oxcriteria in oxarticles and fill it with values 2. update views 3. make it avaliable as sorting criteria in core settings -> settings -> products -> Database Fields Product Lists can be sorted after 4. go to frontend and select Sorting criteria -> will not work | ||||
Tags | Solution Provided | ||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
has duplicate | 0006596 | closed | OXID eShop (all versions) | Category sort by e.g. oxartnum does not work. | |
has duplicate | 0006664 | closed | OXID eShop (all versions) | Sorting by price in categories does not work | |
has duplicate | 0006445 | resolved | saulius.stasiukaitis | Flow theme | sorting by price doesn't work |
has duplicate | 0006553 | closed | QA | OXID eShop (all versions) | Sort by price (asc) sometimes does not work |
child of | 0006083 | resolved | anton.fedurtsya | OXID eShop (all versions) | article sorting fields not verified against valid field from admin settings |
|
oxubase :: getUserSelectedSorting () checks the field name wether it is contained in the array. Because this array does not contain the new field in_array ($ sSortBy, oxNew ('oxArticle') -> getFieldNames (), the sort does not work. The array is filed serialized and located here. For PE tmp / oxpec_fieldnames_oxarticles_alist_i18n.txt For EE tmp / oxeec_fieldnames_oxarticles_alist_i18n.txt |
|
Workaround: If you want to add oxartnum for sorting, the serialized array must be extended from a:1:{s:7:"content";a:18:{s:4:"oxid";i:0;s:10:"oxparentid";i:0;s:10:"oxvarstock";i:0;s:10:"oxvarcount";i:0;s:8:"oxshopid";i:0;s:7:"oxstock";i:0;s:11:"oxstockflag";i:0;s:7:"oxtitle";i:1;s:11:"oxvarselect";i:1;s:7:"oxthumb";i:0;s:6:"oxpic1";i:0;s:11:"oxshortdesc";i:1;s:14:"oxunitquantity";i:0;s:8:"oxtprice";i:0;s:5:"oxvat";i:0;s:7:"oxprice";i:0;s:15:"oxskipdiscounts";i:0;s:8:"oxweight";i:0;}} to a:1:{s:7:"content";a:19:{s:4:"oxid";i:0;s:10:"oxparentid";i:0;s:10:"oxvarstock";i:0;s:10:"oxvarcount";i:0;s:8:"oxshopid";i:0;s:7:"oxstock";i:0;s:11:"oxstockflag";i:0;s:7:"oxtitle";i:1;s:11:"oxvarselect";i:1;s:7:"oxthumb";i:0;s:6:"oxpic1";i:0;s:11:"oxshortdesc";i:1;s:14:"oxunitquantity";i:0;s:8:"oxtprice";i:0;s:5:"oxvat";i:0;s:7:"oxprice";i:0;s:15:"oxskipdiscounts";i:0;s:8:"oxweight";i:0;s:8:"oxartnum";i:0;}} This works with additional fields of the oxarticle table. |
|
pull request https://github.com/OXID-eSales/oxideshop_ce/pull/487 fixes this issue |
|
https://github.com/OXID-eSales/oxideshop_ce/commit/ff2098a5143b6556eecd6418caf6924ca970aaf0 https://github.com/OXID-eSales/oxideshop_ce/commit/4dd85153f3d1ccc1fe901dd51d785a60f42162a6 |