View Issue Details

IDProjectCategoryView StatusLast Update
0005737OXID eShop (all versions)2.6. Administer orderspublic2024-09-25 16:25
ReporterFibreFoX Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.8.4 / 5.1.4 
Summary0005737: selectlists are handled wrong if name or value contains a comma followed by a space
DescriptionMaybe its listed somewhere (didnt found anything about this), but having a comma in the selectlist-value results in strange side-effects:

* oxbasketitem::initFromOrderArticle will no select the right selectlists
* oxorderarticle::getOrderArticleSelectList does not get all selectlists (because explode(",") will catch the value too)
Steps To ReproduceHow we are reproducing it:
1. In admin:
Administer Product-> Selection List create selection list with 2 fields:
ca. 850g, ca. 16cm Durchmesser
ca. 1250g, ca. 22cm Durchmesser
both of them have Price Surcharge
2. Assign the product for this list.
3. Make a purchase of this product.
4. Go to Admin-> Administer Order->Order->Overview
Calculation is good.
5.Go to Admin-> Administer Order->Order->Main Set payment date and look in Overview tab.
Calculation is wrong now.

Additional InformationI tried to have a nicer formatting inside order_overview, but ended up with messed results. My code so far:


public function getNicerSelectionList( $orderArticle ){
    $result = "";
    $selectedListStringNormalized = $orderArticle->oxorderarticles__oxselvariant->value;
    $selectedLists = explode(",", $selectedListStringNormalized);
    foreach( $selectedLists as $singleList ){
        $singleList = trim($singleList);
        if( !empty($singleList) ){
            $listNameAndValue = explode(":", $singleList);
            $result .= $listNameAndValue[0] . ": " . $listNameAndValue[1] . "\n";
        }
    }
    return nl2br($result);
}
TagsSelection List
Attached Files
oxid_bug_5737.JPG (33,595 bytes)   
oxid_bug_5737.JPG (33,595 bytes)   
ThemeAll
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Relationships

related to 0004624 acknowledged Order recalculation does not use discounts/taxes which were valid when order was made, but current ones 
related to 0005254 closedQA Selectlists are not considered correctly 

Activities

FibreFoX

2014-04-15 11:11

reporter   ~0009837

Because oxorderarticle::getOrderArticleSelectList is called in oxbasketitem::initFromOrderArticle .... and ends up being called in oxorder::recalculateOrder, this whole thing may be related to recalculation-bug https://bugs.oxid-esales.com/view.php?id=4624

svetlana

2014-04-29 14:20

reporter   ~0009865

Reminder sent to: FibreFoX

Hi, unfortunately but we can not reproduce this issue. Could you provide more detailed information about how you reproducing it?

FibreFoX

2014-04-29 15:27

reporter   ~0009867

Last edited: 2014-04-29 15:39

Dont know how you tried to reproduce, but please try with this values (i uploaded a screenshot how it looks for me) :
1. "ca. 850g, ca. 16cm Durchmesser"
2. "ca. 1250g, ca. 22cm Durchmesser"
(note that "comma + space" is inside selectlist-value value)

They will destroy the method i wrote here (involves recalculating).

When sending the "your order was send"-mail the layout is not as the "you ordered"-mail, so i looked where it came from ... and realized that they are not stored in a nice way.

I hope this helps a little.

Edit: maybe a serialized array would help a lot here (but would break compatibility)

svetlana

2014-05-02 07:43

reporter   ~0009877

Reminder sent to: FibreFoX

Hi,
Could you please tell us what exactly is your shop version and on which edition you are reproducing it? Also is your shop UTF-8 or not? And what exactly is wrong after you make a purchase? could you please add a screenshot. It would really help us to figure out the problem. Thanks for the patience.

FibreFoX

2014-05-02 09:51

reporter   ~0009878

The problem comes from the methods.
If you are developing modules that are depending on the right selectlist-value (especially when they have price-additions), the current implemented algorithm is wrong.

Please have a look at your own code:
http://docu.oxid-esales.com/CE/sourcecodedocumentation/4.8.5.6fd00216aba774e84700d892fe7c037753ecb0e3/oxorderarticle_8php_source.html#l00383

It doesn't have todo anything with encoding, because your algorithm is flawed for selectlists. The culprit is in line 393, this will go wrong when having a value with ", " within the value itself (as described by me https://bugs.oxid-esales.com/view.php?id=5737#c9867) and thats the reason i suggested another form of that value: using serialize()

And because of that code, even the recalculation of already existing orders are wrong, because they can't find the price-addition (assuming that one selectlist-entry has something like "+3 €" or something).

svetlana

2014-05-02 15:26

reporter   ~0009880

Reminder sent to: FibreFoX

There might be the problem, but we need to reproduce it and at this moment we can't do it, because for us it works like it should be. So something we are doing different.

Please send us information:
- shop version;
- shop edition;
- utf-8 or not
- language of the shop;
- how many selection list do you have;


How we are reproducing it:
1. In admin:
Administer Product-> Selection List create selection list with 2 fields:
ca. 850g, ca. 16cm Durchmesser
ca. 1250g, ca. 22cm Durchmesser
both of them have Price Surcharge
2. Assign the product for this list.
3. Make a purchase of this product.
4. Go to Admin-> Administer Order->Order.
5. Look into returned results/database (table: oxorderarticles, column: oxselvariant)
 Even after recalculation for us it works correct.

leofonic

2014-05-03 14:28

reporter   ~0009883

Last edited: 2014-05-03 14:32

In current Demoshop: Enable price changes by selectlists. Assign surcharge 10€ to "ca. 850g, ca. 16cm Durchmesser" and 20€ to "ca. 1250g, ca. 22cm Durchmesser", assign to article, order both types. Look at order, surcharges are OK, set paydate, look again, both have low surcharge now.

FibreFoX

2014-05-03 14:53

reporter   ~0009884

Thanks leofonic :) i knew i missed something (enabling price-changes by selectlists).

and thats why i think its related to recalculation-bug https://bugs.oxid-esales.com/view.php?id=4624 (which is a real shame, because that bug-ticket is open for such a long time).

svetlana

2014-05-05 09:28

reporter   ~0009885

I reproduced that bug. After payment date is set price of the order is recalculated wrong. But it is not related with comma inside text. Calculation doesn't depend of the name of the selection lists. It is always after payment date is set calculation is incorrect.

FibreFoX

2014-05-05 09:49

reporter   ~0009886

But finding the selected value (with the right surcharge) fails with "comma + space", because it looks for it via its value, that's what this ticket is about, am i wrong?

martinwegele

2015-06-02 10:37

reporter   ~0011005

Related pull request which might have introduced the behaviour (CE 4.8.2 included the change, 4.8.1 not): https://github.com/OXID-eSales/oxideshop_ce/commit/f85158f9ba5c1582d527b9eac1bc2583f5582e92
@QS: We should test if the behaviour of the shop changed from 5.1.1 to 5.1.2.

FibreFoX

2015-06-02 12:42

reporter   ~0011007

This won't fix the problem, if you have something like ", " or "," inside your labels, this still won't work.