Copied to clipboard

Flag this post as spam?

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


  • Leo Garcia 4 posts 84 karma points
    Apr 03, 2019 @ 09:57
    Leo Garcia
    0

    User cannot create a new Form

    Hi,

    I'm having a weird problem with Forms (Umbraco v.7.14.0). Periodically I am finding that a user is unable to create a new form - the panel to create the form is simply blank on clicking 'Create a new form' -> 'Empty form'.

    In the logs I see this error:

    2019-04-02 16:57:45,348 [P34280/D3/T208] ERROR Umbraco.Forms.Web.Editors.FormSecurityController - Unhandled controller exception occurred System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) at Umbraco.Forms.Web.Editors.FormSecurityController.GetByUserId(Int32 userId) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)

    which is weird because I can see in the database that the user that I'm logged in as has no obvious duplicate in the umbracoUser table.

    The only solution I've found, which isn't really a solution, is to disable the user and modify their email address, and create another user with their correct email address, which solves the problem.

    Has anyone else come across this?

  • Dan Diplo 1554 posts 6205 karma points MVP 5x c-trib
    Aug 29, 2019 @ 11:17
    Dan Diplo
    0

    OK, found the issue. It occurs when there are duplicate rows in the UFUserFormSecurity table ie. when a user is assigned to the same form more than once.

    You can determine if there are duplicates by running the following SQL:

    SELECT [User], [Form], COUNT(*) FROM UFUserFormSecurity
    GROUP BY [User], [Form]
    HAVING  COUNT(*) > 1
    ORDER BY [User]
    

    (As an aside, why on Earth is User a varchar column???)

    You need to delete the duplicates and then restart the site (touch web.config) to fix this.

  • Damien Holley 179 posts 540 karma points
    May 04, 2021 @ 05:04
    Damien Holley
    0

    Getting this same error on 8.6.1 with no dupes in db.

Please Sign in or register to post replies

Write your reply to:

Draft