Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
cascade delete in 1.6.1 ?
  • Hi there,

    I noticed some code quite strange when trying to delete a model and its relations.
    Indeed in model.php, function delete, line, 1399 we have :
    $this->freeze();

    then we try to remove relations

    but in function get(), line 1068, we have :
    if ($this->_frozen)
    {
      // avoid a notice, we're returning by reference
      $var = null;
      return $var;
    }

    It means that if the relation has not been used before the $mymodel->delete() call, it won't be deleted.


    I might miss a point ?
  • I'm sorry, of course it's not the right place to post a bug report, I have been confused by the statement on homepage "Join the forum to get help or help others with FuelPHP, find and report bugs"
    I'll report this issue there https://github.com/fuel/orm/issues
  • HarroHarro
    Accepted Answer
    If you're not certain it's a bug, it's better to discuss it here first, it keeps the issue tracker clean.

    Also, if you encounter anything, first try to reproduce it with the latest development branch (currently 1.7/develop). I'm pretty sure this issue was addressed some time ago.
  • Ok i just read your answer on issue tracker.
    I guess many users use 1.6.1 since it's the last stable release. Then i post here the fix so that they can enjoy it : https://github.com/fuel/orm/commit/dcc815e06a5a319154b9c16bb059276d2a1266d2
  • HarroHarro
    Accepted Answer
    We've been trying to get 1.7 out the door for the last few weeks, but as soon as we mention the word "release", people all of a sudden find new bugs that need fixin' ;-)
  • as usual, to hurry slowly is the key :)

Howdy, Stranger!

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

In this Discussion