|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23600 DB_DataObjects: fetch() should reset the 'has links been loaded flag..'
Submitted: 2003-05-12 16:17 UTC Modified: 2003-05-25 21:56 UTC
From: mitch at enetis dot net Assigned: alan_k (profile)
Status: No Feedback Package: PEAR related
PHP Version: 4.3.1 OS: FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mitch at enetis dot net
New email:
PHP Version: OS:


 [2003-05-12 16:17 UTC] mitch at enetis dot net
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.


From: 	Alan Knowles <>
To: 	Mitchell Perilstein <>
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->_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.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-15 00:05 UTC]
can you turn debugging on and see what is happening.
It appears that the link_loaded flag is reset correctly in fetch.

I've checked the cache code - it appears to behaving as expected.. - eg. only reseting the cache if a update succeeds
- can you turn debugging on DB_DataObject::debugLevel(5);
and see what happens

 [2003-05-25 21:56 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 00:01:34 2024 UTC