View Issue Details

IDProjectCategoryView StatusLast Update
0006915OXID eShop (all versions)2.6. Administer orderspublic2018-10-26 17:35
Reporterberkmueller 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version6.0.3 
Target VersionFixed in Version 
Summary0006915: Inconsistency when multiple modules extend templates but don't use explicit sort order
DescriptionDue to a missing default sort order some inconsistencies (e.g. in admin's order list view) can happen where column headers do not match the values in the data rows because of a displacement.

The reason for this is that the default sort order for template blocks (see `\OxidEsales\EshopCommunity\Core\Module\ModuleTemplateBlockRepository::getBlocks()`) is
`order by oxpos asc, oxtheme asc, oxid asc` (https://github.com/OXID-eSales/oxideshop_ce/blob/36c63bae25751ae0fc1962aace2fafc88675c25b/source/Core/Module/ModuleTemplateBlockRepository.php#L60).
That means when two modules extend the same block but have the default oxpos (0), it depends on the generated OXID. Due to the fact that newly generated OXIDs are not lexicographically ordered,
it could be the case that for example module A comes first for extending a tables header in admin but module B is first for extending the data row template. This can lead to inconsistencies as
can also seen in the screenshots provided.

As a simple fix, just change
```
order by oxpos asc, oxtheme asc, oxid asc";
```
to
```
order by oxpos asc, oxtheme asc, oxmodule asc, oxid asc";
```
and the problem is solved.
Steps To Reproduce1.) Given the admin enables the modules fcPayOne and oePayPal (which both extend admin templates in the order list view (header and row templates))
2.) When an order was placed
3.) And a backend user goes to the admin order page
4.) Then the header and rows of the columns "payone ref.nr.", "payment type" and "shop payment status" do not match.
TagsAdmin, Admin Template, Module, Template Blocks
ThemeAll
BrowserAll
PHP VersionAll
MySQL VersionAll

Activities

berkmueller

2018-10-26 15:57

reporter  

order-list-fixed.png (14,326 bytes)
order-list-fixed.png (14,326 bytes)
order-list-with-bug.png (14,198 bytes)
order-list-with-bug.png (14,198 bytes)