From b2299ca343e9aaba22747ca4ab1b3da18440d6fc Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 13 Dec 2010 17:10:13 +0800 Subject: [PATCH] Pman/Roo.php --- Pman/Roo.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Pman/Roo.php b/Pman/Roo.php index fc47ba7..dcfcc2e 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -617,8 +617,17 @@ class Pman_Roo extends Pman $this->jerr('Unable to load referenced table, check the links config: ' .$ka[0]); } $chk->{$ka[1]} = $xx->$pk; - if ($chk->count()) { - $this->jerr('Delete Dependant records first ('. $ka[0]. ':' . $ka[1] .'='.$xx->$pk.')'); + $matches = $chk->count(); + if ($matches) { + $chk->limit(1); + $o = $chk->fetchAll(); + $desc = $ka[0]. ':' . $ka[1] .'='.$xx->$pk + if (method_exists($chk, 'toEventString')) { + $desc = $ka[0] . ' : ' $o[0]->toEventString(); + } + + + $this->jerr('Delete Dependant records first ('. $desc.')'); } } // finally log it.. -- 2.39.2