7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Bug Reports
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 37702 Views |
-
Re: Bug Reports

30 August 2009 at 3:11am Last edited: 30 August 2009 3:12am
When changing the Gallery name the Folder Title always stays NewImageGalleryPage, so when people browse images from the TinyMCE image button, they see x times NewImageGalleryPage.
Fix :
ImageGalleryPage.php
add:
function onBeforeWrite() {
parent::onBeforeWrite();
if( $this->ID )
$this->RootFolder()->Title = $this->Title;
// or $this->MenuTitle?
} -
Re: Bug Reports

1 September 2009 at 5:38am
With PHP 5.3.0, it's not possible to check for objects using get_class(), since it already expects the argument to be an object. Using is_object() solves a number of issues.
-
Re: Bug Reports

1 September 2009 at 6:35am
Yes, sorry for being lazy, I am rushing through a number of projects here
Here is a diff:
Index: code/HasManyFileDataObjectManager.php
===================================================================
--- code/HasManyFileDataObjectManager.php (Revision 252)
+++ code/HasManyFileDataObjectManager.php (Arbeitskopie)
@@ -95,7 +95,7 @@
$records = $dataQuery->execute();
$items = new DataObjectSet();
foreach($records as $record) {
- if(! get_class($record)) {
+ if(! is_object($record)) {
$class = $this->sourceClass;
$record = new $class($record);
}
@@ -106,7 +106,7 @@
$records = $dataQuery->execute();
$unpagedItems = new DataObjectSet();
foreach($records as $record) {
- if(! get_class($record))
+ if(! is_object($record))
$record = new DataObject($record);
$unpagedItems->push($record);
}
Index: code/HasManyDataObjectManager.php
===================================================================
--- code/HasManyDataObjectManager.php (Revision 252)
+++ code/HasManyDataObjectManager.php (Arbeitskopie)
@@ -91,7 +91,7 @@
$records = $dataQuery->execute();
$items = new DataObjectSet();
foreach($records as $record) {
- if(! get_class($record))
+ if(! is_object($record))
$class = $this->sourceClass;
$record = new $class($record);
$items->push($record);
@@ -101,7 +101,7 @@
$records = $dataQuery->execute();
$unpagedItems = new DataObjectSet();
foreach($records as $record) {
- if(! get_class($record)) {
+ if(! is_object($record)) {
$class = $this->sourceClass;
$record = new $class($record);
} -
Re: Bug Reports

1 September 2009 at 7:38am
All that code is lifted from HasManyComplexTableField, actually. Probably ought to submit that bug to them, too. Thanks.
-
Re: Bug Reports

1 September 2009 at 8:58am
Didn't they fix PHP 5.3 issues with v2.3.3 already? I'll have to check later, but afaik I am not encountering any problems with the normal CTF classes.
Thanks to you for the quick response. Your module makes my life so much easier every day.
-
Re: Bug Reports

1 September 2009 at 5:16pm
Yes notices to do with 5.3 have been fixed in 2.3.3 and trunk. The actual root cause of these notices will be fixed in 2.4 etc but they might be too intense to get into 2.3 so hence we just hide the notices.
-
Re: Bug Reports

6 September 2009 at 9:46am
I've checked in a version of these files using is_object instead of get_class.
| 37702 Views | ||
| Go to Top | Next > |



