View Issue Details

IDProjectCategoryView StatusLast Update
0006579OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2017-09-07 10:03
ReporterSpritje Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.10.4 / 5.3.4 
Fixed in Version4.10.6 / 5.3.6 
Summary0006579: Sorting by self-created fields in the oxarticles does not work
DescriptionIf 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 Reproduce1. 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
TagsSolution Provided
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Relationships

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 resolvedsaulius.stasiukaitis Flow theme sorting by price doesn't work 
has duplicate 0006553 closedQA OXID eShop (all versions) Sort by price (asc) sometimes does not work 
child of 0006083 resolvedanton.fedurtsya OXID eShop (all versions) article sorting fields not verified against valid field from admin settings 

Activities

QA

2017-03-01 13:19

administrator   ~0011984

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

QA

2017-03-01 13:24

administrator   ~0011985

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.

keywan.ghadami

2017-03-01 13:34

reporter   ~0011986

pull request
https://github.com/OXID-eSales/oxideshop_ce/pull/487
fixes this issue

saulius.stasiukaitis

2017-09-07 10:03

reporter   ~0012219

https://github.com/OXID-eSales/oxideshop_ce/commit/ff2098a5143b6556eecd6418caf6924ca970aaf0

https://github.com/OXID-eSales/oxideshop_ce/commit/4dd85153f3d1ccc1fe901dd51d785a60f42162a6