Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/Library    [ Add a report in this area ]  
Report #:  111857   Status: Need Feedback
Serious RPCL bug with methods beginning with "set" or "get"
Project:  HTML5 Builder Build #:
Version:    5.0 Submitted By:   Michael Ainsworth
Report Type:  Crash / Data loss / Total failure Date Reported:  1/10/2013 4:46:07 PM
Severity:    Infrequently encountered problem Last Updated: 1/10/2013 6:45:00 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
RPCL does not allow classes derived from forms to include methods beginning with "get" or "set", as this triggers the magic methods for getting and setting properties.

This bug manifested itself in the php "call to undefined method" error message. I've spent at least 2 hours trying to resolve this error, using all the usual tricks - restarting the browser, restarting the IDE, deleting the contents of "C:\Users\<USERNAME\AppData\Local\Temp" including session data, deleting all "__history" files and temporary files beginning with "~".

I've never before used a library that will *** crash *** if you use certain characters in your function names (even very strongly focused "convention over configuration" libraries), an issue that as far as I can tell is *** completely undocumented ***.

The error message is below. Note that the function I'd written was "setAnimalsKeyFromPostData()" (note the "set", not "get", in the function name) but the error message mentioned "getAnimalsKeyFromPostData()" (note here "get", not "set").

?Fatal error: Call to undefined method frmmembershipinventoryanimals::getAnimalsKeyFromPostData() in C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ on line 1164 Fatal error: Uncaught exception 'EPropertyNotFound' with message 'Trying to access non-existant property frmmembershipinventoryanimals->AnimalsKeyFromPostData in, line 1025.' in C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ Stack trace: #0 C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ Object->__get('AnimalsKeyFromP...') #1 C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ Persistent->serialize() #2 C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ CustomPage->serialize() #3 C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ Component->serializeChildren() #4 [internal function]: RPCLShutdown() #5 {main} thrown in C:\Program Files (x86)\Embarcadero\HTML5 Builder\5.0\rpcl\ on line 307
Steps to Reproduce:
To reproduce this error,
create a blank form
write a method beginning with "set".
In the form's "onCreate" method, call this new "set" method.
Two workarounds that I can see.

1. Do not write any methods that start with "get" or "set".
2. Fix the code manually. E.g., edit RPCL's library to use the PHP "ReflectionClass" class to determine whether or not to call the function, or whether to use magic getters and setters.

Tomohiro Takahashi at 1/10/2013 6:45:13 PM -
Could you please attach sample project to verify your issue?

Server Response from: ETNACODE01