Quantcast
Channel: OXID Community Forum
Viewing all articles
Browse latest Browse all 6951

Empty value handling

$
0
0
Hi!

I'm migrating from an older version to 4.7.7 and have trouble copying certain fields (e.g. oxorder.oxpaid) because they have been nullable in the old version db but are non null in the new one. Of course there is no meaningful value I could fill in these fields for existing records, so I went looking into the code how are they used.

One of the usages I found is this (order_main.php):
if ( $oOrder->oxorder__oxpaid->value != "0000-00-00 00:00:00") {

This looks like you are using this zero date as the "null" value. I find this a very strange practice and would suggest Oxid developers to re-think this approach as it is very unconvenient and unintuitive to do these kind of tricks when SQL databases support real null values nicely.

Viewing all articles
Browse latest Browse all 6951

Trending Articles