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 | 2024-01-10 15:25 |
Reporter | leofonic | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 4.7.1 / 5.0.1 revision 52468 | ||||
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 | ||||
Attached Files | |||||
Theme | Not defined | ||||
Browser | All | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
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() ); |
|
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. |