View Issue Details

IDProjectCategoryView StatusLast Update
0004773OXID eShop (all versions)4.07. Source code, Testpublic2024-01-10 15:25
Reporterleofonic Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version4.7.1 / 5.0.1 revision 52468 
Summary0004773: viewconfig changes instance after including widget
Description$oViewConf changes instance after including widget. I wrote a small module that adds a random param "ident" to oxviewconfig on construct. In sidebar.tpl:

[{$oViewConf->getViewConfigParam('ident')}]
    [{block name="sidebar_categoriestree"}]
        [{if $oView->getClassName() != 'start'}]
            [{oxid_include_widget cl="oxwCategoryTree" cnid=$oView->getCategoryId() deepLevel=0 noscript=1 nocookie=1}]
        [{/if}]
    [{/block}]
[{$oViewConf->getViewConfigParam('ident')}]

shows two different ids, so $oViewConf is a new instance after the include. This makes it impossible to store data in viewconfig.
TagsWidgets
Attached Files
testviewconf.zip (1,436 bytes)
ThemeNot defined
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities

leofonic

2013-01-22 16:22

reporter   ~0008309

I tracked this down to oxwidgetcontrol::_runLast():
            // setting back last active view
            $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty();
            $oSmarty->assign('oView', $oConfig->getActiveView() );

here Viewconfig should also be resetted:
            // setting back last active view
            $oSmarty = oxRegistry::get("oxUtilsView")->getSmarty();
            $oSmarty->assign('oView', $oConfig->getActiveView() );
            $oSmarty->assign('oViewConf', $oConfig->getActiveView()->getViewConfig() );

SvenBrunk

2024-01-10 15:25

administrator   ~0016105

This is the intended behavior of the shop. Each widget has (and should have) its own instance of view config. This is necessary to be able to render each widget independently (e.g. have instances in the reverse proxy cache while rendering a new page)
Also each widget can have independent view parameters.