Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/Library    [ Add a report in this area ]  
Report #:  117651   Status: Reported
cannot convert layout to string upon deployment of a server application
Project:  HTML5 Builder Build #:  5.1.167.137
Version:    5.0 Submitted By:   Kevin Day
Report Type:  Crash / Data loss / Total failure Date Reported:  8/5/2013 9:02:02 PM
Severity:    Serious / Highly visible problem Last Updated: 8/24/2013 5:45:35 AM
Platform:    All platforms Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 5
Description
This error has been reported previously but I see no resolution for it so I have reported it again with my own observations.  

The problem is that you can develop the applicaton and it will work fine in html5builder provided platform.  It will also work fine with a separately installed php and apache environment on my windows machine.  But when you try to deploy the application to a linux based hosting service you get the error:

Catchable fatal error: Object of class Layout could not be converted to string in /home2/kevinday/public_html/auction_test/rpcl/classes.inc.php on line 514
Steps to Reproduce:
After some digging around and some experimenting, I have found the problem occurs after you modify at design time any compound object properties like Layout or Font.

When you modify an object property at design time, the form file has the following structure:

<property>
  <property ..>stuff</property>
  <property ..>stuff</property>
</property>

It appears that whenever you have this structure that the problems occur.  Obviously there is some problem with the xml parsing.

To confirm this I created a simple server application that had a button and a label.  The button simply changes the label caption to 'clicked!'.  I deployed the app to the linux hosting service and it worked fine.  I then took the same app and changed the font property of the page.  Upon the deployment to the linux hosting service  and running I get the error "
Catchable fatal error: Object of class Font could not be converted to string in /home2/kevinday/public_html/auction_test/rpcl/classes.inc.php on line 514"  If I change the font property back to the default and deploy and run on the linux service as before it works again.  Similarly if I change the layout property I get the similar error only this time it is "Catchable fatal error: Object of class Layout could not be converted to string in /home2/kevinday/public_html/auction_test/rpcl/classes.inc.php on line 514"

Same issues occur using any compound property including BorderRadius and Animations

For other information that might help to get to the bottom of this:

1.  phpinfo as run from inside html5 builder run application
http://www.kevindayprogramming.com/test/local_phpinfo.html

2.  phpinfo from the linux hosting service
http://www.kevindayprogramming.com/test/unit2.php

Workarounds
set property values at runtime, not design time, defeating the purpose of RAD, but Oh well!
Attachment
None
Comments

Kevin Day at 8/12/2013 1:30:31 AM -
I have discovered the issue can be worked around by removing all end of line markers in the resource xml.php file apart from the opening and closing php tags.  I have written a Delphi program (sorry I am still a Delphi programmer) that on a given directory, including subdirectories, does this on all *.xml.php files.  I run this on my deployment directory just prior to ftp'ing to my hosting service.

Server Response from: ETNACODE01