Page 1 of 1

Cannot modify header information - headers already sent

PostPosted: Fri Apr 03, 2009 2:46 am
by jesteve
Hi,

I have a problem when using delegate class with relationships. More precisely:

1) I define the following delegate class "Orders.php" to change the rendering of one field for the "Orders" table:

class tables_Orders {
function Attachment__renderCell( &$record ){
$attachment = $record->strval('Attachment');
if ($attachment) {
return $attachment;
} else {
return "no";
}
}
}


2) I define a relationship between the "Orders" table and the "Buyers" table using the following "relationships.ini" in the Buyers'directory:

[Orders]
Orders.Buyer_Id = "$Buyer_Id"
actions:addexisting = 0
actions:addnew = 0
action:label = "My orders"

3) Creating a new buyer record leads to the "headers already sent" error:

PHP Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/ACOD/tables/Orders/Orders.php:1) in /Applications/MAMP/htdocs/xataface/actions/new.php on line 159

How can I go around that ?

Many thanks in advance, Jerome.

Bug is solved...

PostPosted: Fri Apr 03, 2009 8:05 am
by jesteve
The bug was due to a file encoding problem which inserted an extra hidden character at the begining of the delegate class file.

For the newbies like me, use "Unicode (no BOM)" instead of "Unicode".

Sorry for that and many thanks for this nice framework...


Jerome.