View Issue Details

IDProjectCategoryView StatusLast Update
0006853OXID ERP InterfaceOXID ERP Interface - subpublic2024-05-22 18:09
ReporterQA Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version3.1.0 
Summary0006853: OXERPSetArticleCategory and OXERPObject2Category overwrites OXTIME with value 0
DescriptionNormally the OXID ERP Interface only sets values for database table attributes, that are explicitly present in the request. All other values from an existing record won't be touched. Though the OXERPSetArticleCategory request inserts a timestamp for OXTIME while executing the request the first time, but overwrites the OXTIME attribute with 0, if the same request is sent again.

If blDeleteOld parameter is set to true, the record will be deleted and reinserted. Because it is an insert, OXTIME will be set with a new timestamp.

In short:
insert -> OXTIME = timestamp
update -> OXTIME = 0

The problem:
If the request will be done two or more times, OXTIME is set to 0, which automatically defines this category a main category of the article. Unfortunately this leads to more than one main category, which isn't supposed to happen.

edit:
The OXERPObject2Category function, which also could be used to assign categories to articles, shows the same behavior. If request with same assignment is sent two or more times, OXTIME is set to 0. Parameter blDeleteOld isn't present there. Only way to avoid multi main categories is to manually set the OXTIME value > 0 for non-main categories. Luckily this is possible with OXERPObject2Category.

[sp]
Steps To Reproduce1) Configurate a OXERPSetArticleCategory request with blDeleteOld parameter set to false.
2) Send the request at least two times and check the database after and in between.
Additional InformationIn my opinion, there are two ways to more or less solve this issue:
1) Change the manner of this request to match the normal OXID ERP Interface behavior. Then it won't come to an issue.
2) Explicitly document this special behavior, including detailed information about the blDeleteOld parameter and how - and even more important - why to use it.

edit:
Since OXERPObject2Category shows the same behavior, solution 2 doesn't sound as effective as before. The behavior doesn't seem to be reasonable at all.
TagsArticle, Category, ERP

Activities

QA

2018-07-12 11:28

administrator   ~0012530

Last edited: 2018-07-13 08:50

Since OXERPObject2Category shows the same behavior, I've updated the issue.

[sp]