_getGalleryChildrenIds{List,Tree} does not work correctly in php 5.2.x
- Status
- Closed
- Subject
- _getGalleryChildrenIds{List,Tree} does not work correctly in php 5.2.x
- Version
- 4.x
- Category
- Error
- Less than 30-minutes fix
- Feature
- File Gallery (elFinder or standard UI)
- Resolution status
- Invalid
- Submitted by
- HobbyBlobby
- Lastmod by
- Ushindi Gedeon
- Rating
- Description
Not all galleries are listed (for example when uploading a file).
The problem is (IMO):
- $allIds is given as reference
- foreach go through the array (with an internal iterator)
- in next recursion step an other foreach is called (but with the same $allIds-object)
- the iterator reaches the end of the array and the loop goes a recursion step back
- the "outer" forach continues, but the iterator of $allIds is at the end of the array
- no other item is checked, if one of the inner recursion steps reach the end of the array
- Solution
- Copy to clipboardmake a copy of $allIds everytime "_getGalleryChildrenIds{List,Tree}"
is called:
Copy to clipboardfunction _getGalleryChildrenIdsList( $allIds, &$subtree, $parentId ) { ...} function _getGalleryChildrenIdsTree( $allIds, &$subtree, $parentId ) { ...} - Workaround
- Importance
- 7
- Easy to solve?
- 8
- Priority
- 56
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 3095
- Created
- Sunday 28 March, 2010 13:07:32 UTC
by HobbyBlobby - LastModif
- Monday 01 June, 2026 20:38:31 UTC