Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Henrik Andersson 2 posts 92 karma points
    Apr 12, 2019 @ 07:16
    Henrik Andersson
    0

    Umbraco Forms 8 cant read table from db?

    Hi!

    I got a strange issue with Umbraco Forms v.8.1.1 running on Umbraco v.8.0.0.

    The forms package is installed with Nuget and works fine running locally but when running on production server with another db( a copy of dev db) I get the following error when clicking on the "forms" tab in the backoffice "ExceptionMessage":"Invalid object name 'UFUserSecurity'.","ExceptionType":"System.Data.SqlClient.SqlException at Umbraco.Forms.Data.Storage.UserSecurityStorage.GetUserSecurity(Object userId)". Same error when clicking on users under the "Form security" folder in the backoffice. I know that the table "UFUserSecurity" exist in the db and the db user has the right permissions but still there seems to be this issue of not finding the table? I also noticed that "UFUserSecurity" isnt updated with new users when adding new users. This also works locally. I noticed that if I uninstall the forms package and reinstall it again the db-tables are not re-created in the db, even if its towards a db where the tables arent present?

    I have been looking for the marker files "/App_Data/TEMP/formsupdate" etc for the table creation but they dont seem to make any difference and maybe this has changed in v.8?

    Has anyone had similar problems?

    BR

    Henrik

  • Henrik Andersson 2 posts 92 karma points
    Apr 12, 2019 @ 12:47
    Henrik Andersson
    100

    To answer my own question. The problem was that the tables were created with the "db_owner" schema and for some reason this coused the poco mapper to not find the tables by the class decorated table name "UFUserSecurity". Changing the schema to dbo with the following sql script solved the problem.

    alter schema dbo transfer db_owner.UFUserSecurity; alter schema dbo transfer db_owner.UFUserFormSecurity; alter schema dbo transfer db_owner.UFRecords; alter schema dbo transfer db_owner.UFRecordFields; alter schema dbo transfer db_owner.UFRecordDataString; alter schema dbo transfer db_owner.UFRecordDataLongString; alter schema dbo transfer db_owner.UFRecordDataInteger; alter schema dbo transfer db_owner.UFRecordDataDateTime; alter schema dbo transfer db_owner.UFRecordDataBit;

Please Sign in or register to post replies

Write your reply to:

Draft