?
avatar PhilETaylor
PhilETaylor
2 Feb 2017

Steps to reproduce the issue

Create a new field of type SQL

Input some crap instead of a SQL (or a sql that doesn't return text and value values)

Expected result

basic validation on saving the field to ensure text and value are strings in the sql input

No errors output to the screen

Actual result

Notice: Undefined property: stdClass::$value in /Users/phil/Downloads/Joomla_3.7.0-beta1-Beta-Full_Package/libraries/joomla/form/fields/sql.php on line 298

Notice: Undefined property: stdClass::$text in /Users/phil/Downloads/Joomla_3.7.0-beta1-Beta-Full_Package/libraries/joomla/form/fields/sql.php on line 298

System information (as much as possible)

Mysql

avatar PhilETaylor PhilETaylor - open - 2 Feb 2017
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Feb 2017
avatar PhilETaylor PhilETaylor - edited - 2 Feb 2017
avatar Bakual
Bakual - comment - 2 Feb 2017

Needs to be fixed in JFormFieldSql then. Or how would you want to sanitizse the input in the field itself? The input will always be a string and the formfield will only know if it's valid SQL when it tries to run it against the database.

However imho it's fine to show an error.
It's not like a visitor is going to create such fields, it's an admin type (site integrator, or similar) who will create those and it will be helpful for him to see the errors.

avatar laoneo
laoneo - comment - 3 Feb 2017

Please test PR #13882. The SQl form field will catch now the exception. About the error handling I'm not sure.

avatar marrouchi
marrouchi - comment - 3 Feb 2017

I was unable to reproduce the issue ...

avatar laoneo
laoneo - comment - 3 Feb 2017

Did you follow the instructions on the pr?

avatar marrouchi
marrouchi - comment - 3 Feb 2017

Yes

avatar zero-24 zero-24 - change - 3 Feb 2017
The description was changed
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-02-03 17:40:43
Closed_By zero-24
avatar zero-24 zero-24 - close - 3 Feb 2017

Add a Comment

Login with GitHub to post a comment