Error with editing Lists

cornutaurus wrote on Wednesday, July 13, 2016:

I tried to edit/update the lists under Administration and it keeps giving me error. It seems that all the lists I tried have the same problem.


ERROR: insert failed: INSERT INTO list_options ( list_id, option_id, title, seq, is_default, option_value, mapping, notes, codes, toggle_setting_1, toggle_setting_2, activity, subtype ) VALUES ( ‘state’, ‘AL’, ‘Alabama’, ‘1’, ‘’, ‘0’, ‘’, ‘’, ‘’, ‘’, ‘’, ‘1’, ‘’ )

Error: Unknown column ‘subtype’ in ‘field list’

C:\xampp\htdocs\openemr\interface\super\edit_list.php at 211:sqlInsert


Could anyone tell me how could I fix this?

sunsetsystems wrote on Wednesday, July 13, 2016:

Perhaps you upgraded but failed to upgrade the database?

This is the commit that added the subtype column. It does seem to handle new installs as well as upgrades.

Rod
http://www.sunsetsystems.com/

cornutaurus wrote on Wednesday, July 13, 2016:

Thank you for your quick respond. I don’t get what you mean by upgrading the database. I created backup using the built-in create backup under Administration. I then uploaded that into a new version of OpenEMR (4.2.2). Beside that I didn’t know what else I have to upgrade.

Also, the link you provided, all I have to do is just copy the codes into the correct files?

Thank you

sunsetsystems wrote on Wednesday, July 13, 2016:

No, don’t change any code. Sounds like you need to browse to openemr/admin.php in your openemr site and see if there’s an “upgrade database” link. If yes you need to run that.

Rod
http://www.sunsetsystems.com/

tmccormi wrote on Wednesday, July 13, 2016:

We really should add that Upgrade/Patch needed logic to the main login page…

cornutaurus wrote on Wednesday, July 13, 2016:

Thank you, I opened the admin.php and saw the update to version 4.2.2 and I did but it stills giving me the same errors. What should I do next?

sunsetsystems wrote on Wednesday, July 13, 2016:

Do admin.php again and see if it’s still asking you to do the database upgrade. If so, the upgrade must have failed.

When you run the database upgrade it dumps a bunch of messages to the screen, showing what it did. You should scroll through all that to see if there were any errors in red. If there are any, report back with details.

Rod
http://www.sunsetsystems.com/

cornutaurus wrote on Thursday, July 14, 2016:

I updated by going to localhost/openemr/admin.php yesterday and I don’t remember it having anything red. But right now it still have the same problem. Right now when I go back into the Lists under Administration - for all the Lists I tried that gave me error before, all the information were gone. So do I have to manually add each on back individually? Thanks

sunsetsystems wrote on Thursday, July 14, 2016:

Not enough information. Does admin.php still have an “upgrade database” link? If so, did you run it again? Also exactly what information is gone? For that, try posting a screenshot.

Rod
http://www.sunsetsystems.com/

cornutaurus wrote on Thursday, July 14, 2016:

Let says I want to update/change something under Lists - I’m using Sex for example. The picture is sex.png

After I click save it shows as in sex1.png

And when I exited out and go back into Lists - Sex it becomes sex2.png

So all the information of the Lists are cleared out and when I tried to put anything in again it showing the erro as in sex1.png


For the Admin I included the picture, this is what it showing. It doesn’t ask me to update anymore.

Thanks

sunsetsystems wrote on Thursday, July 14, 2016:

OK so it appears that in spite of the upgrade being done, the subtype column is still missing. You’ll have to fix this first. Instead of admin.php, go to sql_upgrade.php. Be sure to select from the dropdown the release that you are upgrading from. Then do the upgrade and when it’s done scroll through the output as already mentioned. Somewhere in there you should see:

ALTER TABLE `list_options` ADD COLUMN `subtype` varchar(31) NOT NULL DEFAULT ''

Assuming that happens, your error message should be fixed. Then yes, you will need to add back the data for any lists that got zapped by this.

Rod
http://www.sunsetsystems.com/

cornutaurus wrote on Thursday, July 14, 2016:

Thank you, I did that and it showed this


Processing 4_2_2-to-4_3_1_upgrade.sql …
Updating global configuration defaults…
Updating Access Controls…
DONE upgrading access controls
Updating version indicators…

Database and Access Control upgrade finished.


Still having the same errors.


Also when I check under billing for some patients, I encountered similar problems. See billing.png

sunsetsystems wrote on Thursday, July 14, 2016:

You have to upgrade from release 4.2.1 or earlier to get this and probably other required fixes. Sounds like you selected 4.2.2 and so the required changes were not done. What release were you on before? Whatever it was, select that one.

Rod
http://www.sunsetsystems.com/

cornutaurus wrote on Thursday, July 14, 2016:

Thank you so much, it solved the problem. Now I just have to redo all the lists that was wiped out.

sunsetsystems wrote on Thursday, July 14, 2016:

Cool. You can look at sql/database.sql to see the default contents for lists.

Rod
http://www.sunsetsystems.com/