Hey, Phil, related to an ITFK issue I had mentioned a while back and got a fix in for, I forgot to make sure this part of the fix made it into DMZ:
Code:
DMZ 1.7.1 Line 1786
if(isset($this->has_one[$rf]) && in_array($other_column, $this->fields))
{
if($this->{$other_column} != $o->id)
{
// ITFK: store on the table
$this->{$other_column} = $o->id;
// unset, so that it doesn't get re-saved later.
unset($objects[$index]);
// Remove reverse relationships for one-to-ones
$this->_remove_other_one_to_one($rf, $o);
}
}
If the ITFK field doesn't have to be changed, then the object in the list isn't unset. I propose:
Code:
if(isset($this->has_one[$rf]) && in_array($other_column, $this->fields))
{
// unset, so that it doesn't get re-saved later.
unset($objects[$index]);
if($this->{$other_column} != $o->id)
{
// ITFK: store on the table
$this->{$other_column} = $o->id;
// Remove reverse relationships for one-to-ones
$this->_remove_other_one_to_one($rf, $o);
}
}
This is a bit obscure and probably doesn't affect many people, and in general I believe all it means is an extra call to the save function when _save_relation comes across the object. What exposed it for me is some extra functionality added to an inherited save function that actually ended up crashing the page load with some infinite recursion in this particular circumstance. So, undoubtedly most people wouldn't see much of a negative effect, but I think it's the "more correct" way to just remove it in _save_itfk.