Array to String Conversion

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

Postby graeme1950 » Mon Oct 09, 2006 3:27 am

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Oct 10, 2006 12:12 pm

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Wed Oct 11, 2006 6:06 am

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Oct 11, 2006 8:24 am

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Wed Oct 11, 2006 11:52 am

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

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