Record info retrieval breaking new record input (solved)
Posted: Mon Oct 01, 2012 5:03 pm
I have gone around and around trying to figure out what I need to do to make my code work.
I have the following in the delegate class file of my table in order for me to retrieve the image size of an uploaded image:
But after adding that code, I cannot add new records. The error log tells me:
If I take that code out, I can add new records, no problem...
I know I am doing something that is probably very obvious to REAL coders - could somebody please tell me what I am doing wrong? I suspect I am doing something improper to get the value of the 'img_url' field... Thanks in advance!
I have the following in the delegate class file of my table in order for me to retrieve the image size of an uploaded image:
- Code: Select all
function field__displaysize(){
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
$imgurlrec =& $app->getRecord();
$imgurlfield =& $imgurlrec->getValue('img_url');
$imgurl = 'http://thisisatest.com/input2/tables/img/img_url/'.$imgurlfield;
list($width,$height,$type,$attr) = getimagesize($imgurl);
$displaysize = 'width='.$width.', height='.$height;
return $displaysize;
}
But after adding that code, I cannot add new records. The error log tells me:
- Code: Select all
[02-Oct-2012 00:03:10 UTC] PHP Strict Standards: Only variables should be assigned by reference in /home1/everaft8/public_html/xata/Dataface/Record.php on line 1365
[02-Oct-2012 00:03:18 UTC] PHP Fatal error: Call to a member function getValue() on a non-object in /home1/everaft8/public_html/input2/tables/img/img.php on line 22
If I take that code out, I can add new records, no problem...
I know I am doing something that is probably very obvious to REAL coders - could somebody please tell me what I am doing wrong? I suspect I am doing something improper to get the value of the 'img_url' field... Thanks in advance!