Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Fuelphp upgraded : errors in model->delete()
  • Hello,

    I have upgraded my FuelPHP in an existent project.
    After that, i realize that delete a model fall in error.
    It seems like some related model are updated instead to be deleted in cascade.

    I suppose it try to update FK, but with a NULL value. Ex : Fuel\Core\Database_Exception [ 1048 ]:
    The field 'product_id' can't be empty (null) [ UPDATE `product_units` SET `product_id` = null, `updated_at` = '2016-03-24 11:18:27' WHERE `id` = '16' ]

    I didn't find in the changelogs some information about that. Could you help me ?
  • HarroHarro
    Accepted Answer
    Double check your relation definitions, are they ok? Every relation should have a "belongs_to", and it must be on the model that has the foreign key.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion