Fatal error: Call to a member function getFileID() on a non-object
Permalink
Hi, i'm still trying to get a file upload working for studio testimonial block, i've had no response from the dev himself so trying here.
I have added the code below, but am getting the error:
Fatal error: Call to a member function getFileID() on a non-object in /home/insure/public_html/packages/studio_testimonials_pro/blocks/studio_testimonials_pro/tools/submit_testimonial.php on line 17
not sure why its not creating an object any ideas greatly appreciated :)
I have added the code below, but am getting the error:
Fatal error: Call to a member function getFileID() on a non-object in /home/insure/public_html/packages/studio_testimonials_pro/blocks/studio_testimonials_pro/tools/submit_testimonial.php on line 17
not sure why its not creating an object any ideas greatly appreciated :)
$postdata = $_POST; Loader::library("file/importer"); $fi = new FileImporter(); $upimage = $fi->import($_FILES['image']['tmp_name'], $_FILES['image']['name']); Loader::model('file_set'); $fs = FileSet::getByName('Test Uploads'); $fsf = $fs->addFileToSet($upimage); $postdata['image'] = $upimage->getFileID(); Loader::model('testimonial', 'studio_testimonials_pro'); $res = Testimonial::add($postdata);
Ok, if anyone else needs this.... I had to change the way the ajax form was submitted:
But its all working now thanks to a few willing volunteers, thank you :)
$.ajax({ url: $(this).attr('action'), type: 'POST', data: formData, async: false, success: function (returndata) { alert('<?php echo t('Thank you for your submission, bear with us while we review the details (just to make sure your photo isn’t too rude) and then it’ll appear on the website. Thanks!’.'); ?>') $.fn.dialog.closeTop(); }, cache: false, contentType: false, processData: false });
But its all working now thanks to a few willing volunteers, thank you :)
However the form is still not working as expected, it's an ajax validation issue I think, but not too sure...
Any ideas please?
if i remove the validation it works, but if its there it fails :(