Editor Not Saving when enter pressed
Editor Not Saving when enter pressed
I have a very simple page based closely on the examples you provide for a left join.
http://offwidth.com/stms/teams.html
All works very nicely, display, dropdown, the joined table data, however when editing, a new selection is made, and update selected, it doesn't save.
When trying to create a new record, the editor screen refreshes with "A system error has occurred"
in the debugger/resource log I get the following:
Warning: require(/hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Exception/Exception.php): failed to open stream: No such file or directory in /hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Bootstrap.php on line 43
Fatal error: require(): Failed opening required '/hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Exception/Exception.php' (include_path='.:/usr/local/lib/php-5.3.29-amd64/lib/php') in /hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Bootstrap.php on line 43
I saw a thread from 2013 where someone had a similar problem and Allan asserted that a bug in the (then) current Editor release was causing an issue that obfuscated the actual problem.
Any thoughts?
Thanks
Bryan
Replies
HI Bryan,
It looks like this might have crept back in. Its a namespacing issue which doesn't effect all versions of PHP which is why it is possible for this to raise its ugly head again. It particularly effects old versions of PHP such as 5.3.x.
Basically the
Exception
s that Editor throws has to be prefixed with a\
to make them load correctly.I've just grep-ed the code and found two references to
PDOException
without a leading backslash (in Database/Drivers/Mysql/Query.php and Database/Drivers/Postgres/Query.php). It would be with adding a back slash in front of those two statements - both in the_exec
functions for their respective files.I'm not convinced that will solve it though since the error message doesn't refer to the
PDO
aspect.What database are you using? Could you also show me the code in the
table.teams.php
file please?Thanks,
Allan
Thanks Allan.
using mysql 5.6.35
here is the table.teams.php content
Thanks! Could you add
->tryCatch( false )->debug( true )
immediately before the->process( $_POST )
line please? Then when you submit the data to the server, what does the JSON returned from the server look like?That will disable Editor's try / catch, which might give us more debugging information, and if it gets far enough some information about the SQL being executed.
Allan
added the code as requested.
on normal page load of the teams page (no edit or update attempt) the table.teams.php returns the following json: (see attached file) I hadn't provided that before.
When I run a 'create' I get the following:
Warning: require(/hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Exception/Exception.php): failed to open stream: No such file or directory in /hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Bootstrap.php on line 43
Fatal error: require(): Failed opening required '/hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Exception/Exception.php' (include_path='.:/usr/local/lib/php-5.3.29-amd64/lib/php') in /hermes/walnaweb10a/b131/moo.bryanforsyth/stms/php/lib/Bootstrap.php on line 43
Which doesn't seem to be any different.
Thank
Bryan
Any thoughts on this Allan?
Hi Bryan,
Sorry about the delay!
I think I've just found it. In the Editor.php file, in the second last method (
_pkey_validate_insert
) you will find:The
Exception
should have a leading\
for compatibility with PHP 5.3 - e.g.:That said, you will still get an error message, but a "controlled" on this time!
Regards,
Allan
Thank you Allan, that change did produce a 'controlled' error. I have it working now, I found some errors in my join syntax.
Best
Bryan
Phew - got there in the end! Thanks for letting me know about this issue. It will be fixed for 1.6.2.
Allan
hi
allan
i have problem
i want check database if row with same value in event_level and event_id not available in the database
isert the new row
if available show error
A global validator is the way to do that. Query the database to see if the values are present or not. If in error then return a string with the error message from the validator. If valid return
true
.Allan