View Issue Details

IDProjectCategoryView StatusLast Update
0004773OXID eShop (all versions)4.07. Source code, Testpublic2015-12-01 10:43
Reporterleofonic 
PrioritynormalSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.7.1 / 5.0.1 revision 52468 
Target VersionFixed in Version 
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
ThemeNot defined
BrowserAll
PHP VersionNot defined
MySQL VersionNot defined

Activities

leofonic

2012-12-05 10:14

reporter  

testviewconf.zip (1,436 bytes)

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() );