View Issue Details

IDProjectCategoryView StatusLast Update
0005854OXID eShop (all versions)2.3. Extensions (modules, themes)public2014-12-10 14:35
Reportersse Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSDebianOS Version7
Product Version4.8.7 / 5.1.7 
Target Version4.9.3 / 5.2.3Fixed in Version6.0.0-beta.1 
Summary0005854: Can not extend deliverytypes in delivery_main
DescriptionIf 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"
TagsNo tags attached.
Attached Files
deliverytype.zip (1,588 bytes)
ThemeAzure
BrowserAll
PHP Version5.4
Database Versionany

Activities

leofonic

2014-10-06 10:56

reporter   ~0010210

Priority high Severity block? You do not create a default object before assigning properties to it in your module, thus this message.

sse

2014-10-06 14:06

reporter   ~0010211

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.

leofonic

2014-10-06 15:29

reporter   ~0010213

Yes you're right this should be in a method. You could create a pull request on github for this.

sse

2014-10-07 08:31

reporter   ~0010214

Done.

jurate.baseviciene

2014-10-07 10:26

reporter   ~0010215

https://github.com/OXID-eSales/oxideshop_ce/pull/171 pull request for this bug

Linas Kukulskis

2014-12-10 12:41

reporter   ~0010400

fixed with pull request