View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002842 | OXID eShop (all versions) | 2. ----- eShop backend (admin) ----- | public | 2011-05-05 19:30 | 2011-05-31 09:46 |
Reporter | Moehlis | Assigned To | |||
Priority | urgent | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.0 revision 34568 | ||||
Fixed in Version | 4.5.1 revision 38045 | ||||
Summary | 0002842: wrong shopid in admin | ||||
Description | Using $this->getConfig()->getShopId() in admin will return 1 if the "shp" parameter is not present in post/get data. This leads to errors in saving data because the data is saved in the wrong shop. | ||||
Steps To Reproduce | - create additional subshop with an individual url - create own admin view and template with a form to submit, set the fnc to some method within your view - within the method, output $this->getConfig()->getShopId() - submit the form --> in all subshops you will get the id 1 -> redo these steps after deleting the individual url for your subshop and you will magically get the correct shopid | ||||
Additional Information | Thats because the form submitted doesnt include the "shp" parameter which is set within oxviewconfig.php:getHiddenSid() If the shp parameter will be put into your form as hidden param is determined by oxconfig.php:mustAddShopIdToRequest(). And there is the problem. If the shop has its own url, the shp parameter isn't necessary what is absolutely right - in the frontend! Possible bugfix, checking for admin: public function mustAddShopIdToRequest() { $blMustAdd = false; //in case shop has no separate URL and is not base shop - adding shop id to url if ( $this->isAdmin() || ($this->getShopId() > 1 && !$this->getConfigParam( 'sMallShopURL' )) ) { $blMustAdd = true; } return $blMustAdd; } | ||||
Tags | No tags attached. | ||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
related to | 0002925 | resolved | dainius.bigelis | Changes in CMS Pages of a subshop are saved for all Subshops. |
has duplicate | 0002989 | closed | birute_meilutyte | shopid gets lost in forms (using $oViewConf->getHiddenSid()) |
related to | 0002875 | resolved | vilma_liorensaityte | oxConfig::mustAddShopIdToRequest() does not check admin state (EE only) |
|
@developers: check from source code side if described problem still exist and if offered solution is useful |
|
No idea why you didn't have more trouble. You actually can't create any objects (articles, CMS snippets, languages) - tested with individual sub-shops. So this is the severiy block, not minor. I have a minimal different solution: if ($this->getShopId() > 1 && (!$this->getConfigParam( 'sMallShopURL' ) || $this->isAdmin()) ) { Please make 100% sure, that this is asap fixed in 4.5.1 |
|
Damn, you're right. I didn't checked the oxid standard cases because it was unbelievable that the 4.5 was never tested for its mall functionality :-O |