?
avatar quantumwebco
quantumwebco
29 Jul 2017

Steps to reproduce the issue

I have a custom module with a SQL form field

<config>
    <fields name="params">
        <fieldset name="basic">
            <field
                   name="grid_id"
                   type="sql"
                   default="1"
                   label="Select an imagegrid"
                   query="SELECT grid_name AS value, grid FROM #__imagegrid" />
        </fieldset>
    </fields>
</config>

Expected result

No error

Actual result

Notice: Undefined property: stdClass::$grid_id in libraries/joomla/form/fields/sql.php on line 308

System information (as much as possible)

Joomla 3.7.4
Apache
MySQL

Additional comments

Is this a problem with my module or something in Joomla core? Thanks

avatar quantumwebco quantumwebco - open - 29 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - change - 29 Jul 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 29 Jul 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 29 Jul 2017
Category com_fields
avatar zero-24 zero-24 - change - 29 Jul 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-07-29 10:30:35
Closed_By zero-24
avatar zero-24 zero-24 - close - 29 Jul 2017
avatar zero-24
zero-24 - comment - 29 Jul 2017

This sql thing needs to have a key & value. Please take a look here: https://docs.joomla.org/SQL_form_field_type

Also the usage of the parameter query should be reduced please use the sql_* fileds in the from.

I'm going to close this as not a core bug thanks. Reopen if needed

avatar quantumwebco
quantumwebco - comment - 29 Jul 2017

Ah sorry, silly me! Thanks a lot! Fixed!

Add a Comment

Login with GitHub to post a comment