View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006915 | OXID eShop (all versions) | 2.6. Administer orders | public | 2018-10-26 15:57 | 2024-06-05 10:36 |
Reporter | berkmueller | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 6.0.3 | ||||
Summary | 0006915: Inconsistency when multiple modules extend templates but don't use explicit sort order | ||||
Description | Due 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 Reproduce | 1.) 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. | ||||
Tags | Admin, Admin Template, Module, Template Blocks | ||||
Attached Files | |||||
Theme | All | ||||
Browser | All | ||||
PHP Version | All | ||||
Database Version | All | ||||
|
There is now a defined order in OXID 7 determined not by module id, but module order in the chain. See https://docs.oxid-esales.com/developer/en/7.1/development/modules_components_themes/module/using_twig_in_module_templates.html#fine-tuning-the-template-inheritance-process for more info and on how to fine-tune it. |