View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004773 | OXID eShop (all versions) | 4.07. Source code, Test | public | 2012-12-05 10:00 | 2023-11-17 13:17 |
Reporter | leofonic | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 4.7.1 / 5.0.1 revision 52468 | ||||
Target Version | Fixed in Version | ||||
Summary | 0004773: 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. | ||||
Tags | Widgets | ||||
Theme | Not defined | ||||
Browser | All | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
testviewconf.zip (1,436 bytes) |
|
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() ); |