Bug - Select list field, dynamic SQL saving failure.

More
13 years 8 months ago - 13 years 8 months ago #9626 by sankesolutions
Edit: I meant to post this in the bug forum not sure how it got in here, can a mod move please (sorry).

I am building my content type and I have created a field called 'incident type'. This field is a select box, and I have used the mysql option to load the options from another table in the database.

The sql query works well, and the select box loads populated with the fields in my DB table, I can select an item and click save/Apply. However when the page is reopened or reloads the selected item is not selected anymore and the field returns to the default 'Please select option'. The database is not storing the default choice.

The custom sql I am using (which works because the list populates) is as follows. I cant see I have done anything wrong, so presume its a bug!
Code:
SELECT `incident_type_id` AS value,`incident_type_name` AS text FROM `jos_incident_type`

I have also attached some screen shots.
[attachment=2:o9a5th2v]<!-- ia2 -->mysql_table.jpg<!-- ia2 -->[/attachment:o9a5th2v]
[attachment=1:o9a5th2v]<!-- ia1 -->field_properties.jpg<!-- ia1 -->[/attachment:o9a5th2v]
[attachment=0:o9a5th2v]<!-- ia0 -->editing_content_item.jpg<!-- ia0 -->[/attachment:o9a5th2v]
Attachments:
Last edit: 13 years 8 months ago by sankesolutions.

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #9627 by sankesolutions
Some more images :)
[attachment=2:erwywfoo]<!-- ia2 -->choice_selected.jpg<!-- ia2 -->[/attachment:erwywfoo]
[attachment=1:erwywfoo]<!-- ia1 -->after_save_apply.jpg<!-- ia1 -->[/attachment:erwywfoo]
[attachment=0:erwywfoo]<!-- ia0 -->db_after_save.jpg<!-- ia0 -->[/attachment:erwywfoo]
Attachments:

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #9658 by sankesolutions
Had a brainwave and fixed my own bug :lol:

The problem was that the name was 'Incident Type' in the field settings and in the select box html the id="incident type".

I changed the field name to be incident_type (without the space) and it fixed the issue.

maybe like the default joomla article, any spaces in the name field should be converted to underscores!

cheers
Paul

Please Log in or Create an account to join the conversation.

More
13 years 8 months ago #9897 by micker
cool
can you edit your title poste and add [solved]
thanks

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.309 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline