View Issue Details

IDProjectCategoryView StatusLast Update
0005103OXID eShop (all versions)2.3. Extensions (modules, themes)public2023-11-20 10:40
Status closedResolutionno change required 
Product Version4.7.5 / 5.0.5 
Target VersionFixed in Version 
Summary0005103: Metadata -> blocks -> file do not handle correctly if paths do not start with '/'
DescriptionCurrently only possible to write path to your block template with slash in front. That is wrong, as given path is relative, not absolute. Shop should handle bot way.
Shop tries to fallback for old versions in oxutilsview::_getTemplateBlock. Maybe would be better first to check if file exist and do fallback only if file do not exist.

Move those lines after check if file exist.

        // for < 4.6 modules, since 4.7/5.0 insert in oxtplblocks the full file name and path
        if ( basename($sFile) == $sFile ) {
            $sFile = "out/blocks/$sFile";
Steps To ReproduceCreate module with one block template. Add some information in block template. This information would not bee visible in footer.
    'blocks' => array(
        array('template'=>'layout/footer.tpl', 'block'=>'footer_main', 'file'=>'extend_block.tpl'),

Fix metadata, renew module information in database. Now information from block template is visible.
    'blocks' => array(
        array('template'=>'layout/footer.tpl', 'block'=>'footer_main', 'file'=>'/extend_block.tpl'),
TagsNo tags attached.
PHP VersionNot defined
Database VersionNot defined


Sven Brunk

2023-11-20 10:40

administrator   ~0015821

Even if this would still be the case, it would be irrelevant since twig now handles the template override.
See on how to do it.