7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'
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: | 1301 Views |
-
Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

16 November 2009 at 11:04am
Hello,
I want to use the FileDataObjectManager with a Special Filetype, cause i need some additional functions for the uploaded pdf file.
my DataObject (ResourceFile.php):
class ResourceFile extends DataObject {
static $db = array (
'Name' => 'Text',
'Description' => 'Text',
);
static $has_one = array (
'pdf' => 'PdfFile',
'DocumentsPage' => 'DocumentsPage'
);
public function getCMSFields_forPopup() {
$pdfFile = new FileIFrameField('pdf');
$pdfFile->setAllowedExtensions(array('pdf'));
return new FieldSet(
new TextField('Name'),
new TextareaField('Description'),
$pdfFile,
);
}
}DocumentsPage.php:
class DocumentsPage extends Page {
static $has_many = array(
'Documents' => 'ResourceFile'
);
public function getCMSFields() {
$f = parent::getCMSFields();
$manager = new FileDataObjectManager(
$this, // Controller
'Documentss', // Source name
'ResourceFile', // Source class
'pdf', // File name on DataObject
array(
'Name' => 'Name',
'Description' => 'Description',
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
$manager->setBrowseButtonText("Upload (pdf only)");
$manager->setAllowedFileTypes(array('pdf'));
$f->addFieldToTab("Root.Content.Documents",$manager);return $f;
}
}class DocumentsPage_Controller extends Page_Controller {
}Even if i use the following PdfFile.php, i get this error, wenn i try to import a PDF (from Upload folder) in Backend:
class PdfFile extends File {
function BackLinkTracking() {
return false;
}
}I have no idea what is wrong. Hopefully someone can help me.
Thanks
escaped
-
Re: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

16 November 2009 at 11:07am
Using ss 2.3.3 and latest version of DataObjectsManager. (r324).
-
Re: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

16 November 2009 at 11:56am
You have a typo here:
'Documentss', // Source name
-
Re: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

16 November 2009 at 12:52pm
This is weird. The bug was resolved a while back here:
http://www.silverstripe.org/dataobjectmanager-module-forum/show/269282?start=24
But I think some revisions to the way imports are handled undid that change. Please change line 534 of FileDataObjectManager.php to:
if($this->fileClassName != "File" && $file->ClassName != $this->fileClassName) {
$file = $file->newClassInstance($this->fileClassName);
$file->write();
}And let me know if that solves your problem. If it does, I'll check in the change. Thanks.
-
Re: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

16 November 2009 at 9:56pm
perfect! it works
thanks you!
escaped
-
Re: Uncaught Exception: Object->__call(): the method 'backlinktracking' does not exist on 'PdfFile'

17 November 2009 at 2:07am
Great. I'll check in the change.
| 1301 Views | ||
|
Page:
1
|
Go to Top |

