Update Blob field not working properly?

A place for users and developers of the Xataface to discuss and receive support.

Update Blob field not working properly?

Postby jvinolas » Mon Mar 21, 2011 6:06 am

Hi Steve,

I have blob fields to store on mysql images that work as expected when creating a new table entry. The problem comes when I try to update a record that didn't have the blob field already: the blob field seems to be updated, but not the _mimetype and _filename.

I don't know if I'm doing something wrong or this is the default behaviour. Right now, I'm updating those fields myself with default data. How can I get mimetype and filename updated correctly (and if possible, automatically)?

Code: Select all
function beforeUpdate(&$record){
   if($record->val('PDFOutline')){
      $record->setValues(array('PDFOutline_mimetype' => 'image/jpeg','PDFOutline_filename' => 'user.jpg'));
   }
}


I also noticed that clicking on X to delete file, says that it went ok, but the blob is still there. Do I have to code the delete myself on beforeupdate() and beforeSave() events?

This is my blob definition in fields.ini:

Code: Select all
__sql__ = "select *, UserName as FOTO, CONTRACTE as CONTRACTECONF from users"
[FOTO]
widget:label="Fotografia"
noLinkFromListView=1
[PDFOutline]
widget:label = "Fotografia"
widget:description = "Les imatges han de ser d'un màxim de 75x75 píxels."
[PDFOutline_mimetype]
visibility:find=hidden
visibility:list=hidden
visibility:browse=hidden
visibility:update=hidden
visibility:csv=hidden
widget:type=hidden
ignore=1
[PDFOutline_filename]
visibility:find=hidden
visibility:list=hidden
visibility:browse=hidden
visibility:update=hidden
visibility:csv=hidden
widget:type=hidden
ignore=1


Thanks!
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am

Re: Update Blob field not working properly?

Postby ADobkin » Wed Nov 02, 2011 1:14 am

jvinolas wrote:I also noticed that clicking on X to delete file, says that it went ok, but the blob is still there.


I had this same problem with deleting blob data. I submitted a report to the bug tracker about a month ago:

0000854: Deleting uploaded file (delete_file action) fails to null blob field
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 9 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved