7919 Posts in 1358 Topics by 932 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DataObject::delete() called on a DataObject without an ID
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 420 Views |
-
DataObject::delete() called on a DataObject without an ID

11 March 2012 at 10:36am
I have found some documentation on this error but don't really know how to fix it. Can someone help please.
When I try and remove an ImageGallery Page I get this error, I can unpublished or delete from draft. But not BOTH....thanks
------------------------
500//ERROR [User Error]: Uncaught Exception: DataObject::delete() called on a DataObject without an ID
IN POST /mysite/admin/EditForm
Line 1126 in /Users/mysite/Sites/jcphotography/sapphire/core/model/DataObject.phpSource
======
1117: */
1118: public function delete() {
1119: $this->brokenOnDelete = true;
1120: $this->onBeforeDelete();
1121: if($this->brokenOnDelete) {
1122: user_error("$this->class has a broken onBeforeDelete() function. Make sure that you call
parent::onBeforeDelete().", E_USER_ERROR);
1123: }
1124:
1125: // Deleting a record without an ID shouldn't do anything
* 1126: if(!$this->ID) throw new Exception("DataObject::delete() called on a DataObject without an ID");
1127:
1128: foreach($this->getClassAncestry() as $ancestor) {
1129: if(self::has_own_table($ancestor)) {
1130: $sql = new SQLQuery();
1131: $sql->delete = true;
1132: $sql->from[$ancestor] = "\"$ancestor\"";Trace
=====
<ul>DataObject->delete()
line 81 of ImageGalleryPage.phpImageGalleryPage->onBeforeDelete()
line 1120 of DataObject.phpDataObject->delete()
line 696 of CMSMain.phpCMSMain->delete(Array,Form,SS_HTTPRequest)
line 329 of Form.phpForm->httpSubmission(SS_HTTPRequest)
line 143 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.phpController->handleRequest(SS_HTTPRequest)
line 282 of Director.phpDirector::handleRequest(SS_HTTPRequest,Session)
line 125 of Director.phpDirector::direct(/admin/EditForm)
line 127 of main.php</ul>
http://localhost:8888/mysite/cms/javascript/LeftAndMain.js?m=1328047220
Line 497
| 420 Views | ||
|
Page:
1
|
Go to Top |

