Page 1 of 1

PostPosted: Mon Oct 09, 2006 3:27 am
by graeme1950
I've got two tables; customers and orders (table name: type2orders) linked via a one-to-many relationship on a Unique Reference Number (URN). This seems to work fine till I want to remove an ordered item out of the orders table. then I get. I'm running the latest version 0.6 and I've looked the forum for the other indications on notices, but they don't specifcally apply to this instance.

Notice: Array to string conversion in /home/default/[website]/user/htdocs/dataface/Dataface/Error.php on line 61

Are you sure you want to remove the following records from the relationship 'type2orders'?

* 8382

Any ideas please

Graeme Hird

PostPosted: Tue Oct 10, 2006 12:12 pm
by shannah
Hi Graeme,

Thanks for pointing this out. Other than this error message, does it seem to be working ok when you try to remove the record?

Luckily this looks like it is just an error, inside the error handler itself. To fix this problem, please try making a small change to the Dataface/Error.php file:

On line 61 it will look like:
Code: Select all
$arg = array_map('strval', $arg);


Try prepending an '@' character to the array_map() call as follows:
Code: Select all
$arg = @array_map('strval', $arg);


This should suppress the error.


Let me know if this works.

Best regards

Steve

PostPosted: Wed Oct 11, 2006 6:06 am
by graeme1950
Thanks Steve ~ that worked fine.

I'm guessing that my php set up is not quite as it should be? I seem to have to re-arrange your coding to suppress errors. Is there anything I should change, yet retain some degree of reporting. I guess I can suppress all errors in php, but this might not be too prudent!

Thanks very much for your help
Best Regards
Graeme

PostPosted: Wed Oct 11, 2006 8:24 am
by shannah
This particular error should rightfully be displayed since it is lazy programming ( :) ).. Since it is in the error handler, though, and it has no bearing on functionality, it does no harm to suppress it. Are you seeing other errors?

-Steve

PostPosted: Wed Oct 11, 2006 11:52 am
by graeme1950
Basically no, unless I try to break it as a user might.
I have only had errors where there is an empty result, and I'm still learning how to handle Dataface so I'm probably creating something I shouldn't. Once I have worked out how to use it for my applications I will have a more rounded approach on how to use Dataface.

I think that any future errors that come up I'll be able to spot as to what may have caused it.
Thanks again for your support and the product.
Best Regards
Graeme