View Issue Details
|OXID eShop (all versions)
|2.3. Extensions (modules, themes)
|4.8.7 / 5.1.7
|4.9.3 / 5.2.3
|Fixed in Version
|0005854: Can not extend deliverytypes in delivery_main
|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"
|No tags attached.
deliverytype.zip (1,588 bytes)
|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.
|https://github.com/OXID-eSales/oxideshop_ce/pull/171 pull request for this bug
|fixed with pull request