#23600 [NEW]: DB_DataObjects: fetch() should reset the 'has links been loaded flag..'
| From: | mitch at enetis dot net | Date: | Mon, 12 May 2003 21:17:41 +0000 |
| Subject: | #23600 [NEW]: DB_DataObjects: fetch() should reset the 'has links been loaded flag..' | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-16195@lists.php.net to get a copy of this message | ||
From: mitch at enetis dot net
Operating system: FreeBSD
PHP version: 4.3.1
PHP Bug Type: PEAR related
Bug description: DB_DataObjects: fetch() should reset the 'has links been loaded flag..'
Filing report at Alan's request.
While this is grinding, I'll try to work up an isolated
test case that doesn't involve 20 tables.
Host's PHP is actually 4.2.3, but not believed to be related.
-mitch
From: Alan Knowles <alan@akbkhome.com>
To: Mitchell Perilstein <mitch@enetis.net>
Cc: pear-general@lists.php.net
Subject: [PEAR] Re: DB_DataObjects: How to mix clone and getLinks?
Date: Sun, 11 May 2003 22:17:31 +0800
Mitchell Perilstein wrote:
Hi all,
>
> I often do stuff like this:
>
> $obj = new DataObjects_MyThing();
> $obj->find();
> while ($obj->fetch()) {
> $objc = $obj->__clone();
$objc->getLinks();
>
$objc->_someChild->foo = 42;
> $objc->_someChild->bar = 'quack';
> $objc->_someChild->update();
> }
>
> For each found object, the loop should do something to a "_" child,
> which was loaded with getLinks(), and then does a db update on it.
>
> Each time through the loop, it seems getLinks() provides the OLD copy
> obj's child, ie, it is not reloaded and so does not reflect any of the
> prior updates().
>
> Is this expected? Is this over-eager caching?
>
It probably a bug - the fetch() call should reset the 'has links been
loaded flag..'
- can you file it as a bug.
Regards
Alan
--
Edit bug report at http://bugs.php.net/?id=23600&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23600&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23600&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23600&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23600&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23600&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23600&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23600&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23600&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23600&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23600&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23600&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23600&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23600&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23600&r=gnused