View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005854 | OXID eShop (all versions) | 2.3. Extensions (modules, themes) | public | 2014-08-19 16:38 | 2014-12-10 14:35 |
Reporter | sse | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux | OS | Debian | OS Version | 7 |
Product Version | 4.8.7 / 5.1.7 | ||||
Target Version | 4.9.3 / 5.2.3 | Fixed in Version | 6.0.0-beta.1 | ||
Summary | 0005854: Can not extend deliverytypes in delivery_main | ||||
Description | If you want to add a new deliverytype to the render method in controllers/admin/delivery_main.php you will get the following PHP Warning in PHP 5.4: "Warning: Creating default object from empty value" Would be nice to make it possible to add custom deliverytypes by moving the deliverytypes to a new method or by making the deliverytypes configurable in another way. | ||||
Steps To Reproduce | - activate the attached module in your shop - go to Shop Settings -> Shipping Cost Rules - add a new rule with deliverytype "test" | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Theme | Azure | ||||
Browser | All | ||||
PHP Version | 5.4 | ||||
Database Version | any | ||||
|
Priority high Severity block? You do not create a default object before assigning properties to it in your module, thus this message. |
|
The problem seems to be the property "selected", which is set in the render method where the new deliverytype is not yet available. So there is only the selected property without the sType and sDesc property. Why not simply outsource the deliverytypes into a new method and call this method in the render method? This would make it a lot easier to extend the deliverytypes. |
|
Yes you're right this should be in a method. You could create a pull request on github for this. |
|
Done. |
|
https://github.com/OXID-eSales/oxideshop_ce/pull/171 pull request for this bug |
|
fixed with pull request |