Starts in:
0 DAY
18 HRS
51 MIN
35 SEC
Starts in:
0 D
18 H
51 M
35 S
Open Closed

Malformed entity generation in ABP Suite #7386


User avatar
0
alboy created
  • ABP Framework version: v8.1.3, v8.1.4, v8.2.0-rc5
  • UI Type: Blazor Server, Blazor WASM, Blazor Web App
  • Database System: EF Core SQL Server
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: no exceptions, other than malformed code
  • Steps to reproduce the issue: create entities in ABP suite until the issue happens, I find it happens usually at the 5th entity. Full description below

ABP Suite seems to be failing to generate entities correctly. I can't find anyone else experiencing this problem looking at previous support tickets.

From what I can see, there is nothing mentioned in the logs even after setting suite logging verbosity to verbose. I am unsure of *exact *reproduction steps, but this has happened on 3 individual projects (I can share each json file if you want)

After a certain amount of entities created, it gets to a point where it generates malformed entities.

Here is an example of what is generated in MyEntity.extended.cs, with basic string properties "TestOne", "TestTwo", and "TestThree"

    public MyEntity(Guid id, )
        : base(id, )
    {
    }     

This is invalid code that of course will not compile. It seems to be failing to add properties of my entity in several places, like the base entity, extended entity, tests, as well as create and update methods and Dto's in the backend. It should look like

    public MyEntity(Guid id, string testOne, string testTwo, string testThree)
        : base(id, testOne, testTwo, testThree)
    {
    }     

I have tried versions 8.1.3 (where I first noticed the issue), 8.1.4, and 8.2.0-rc5. I've also tried changing generation options like turning off crud page generation, turning off custom code, disabling backend etc and it didn't seem to make a difference. Tried Blazor Server, WASM, and Web App. Also tried clearing my Nuget cache in case it was resolving wrong package versions etc.

All 3 of the projects I've tested on have been more or less stock. The only other changes I've made have been to add some modules, and tweak some templates adding some more hooks in them etc.


6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    I will check it

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I could not reproduce the problem.

    From what I can see, there is nothing mentioned in the logs even after setting suite logging verbosity to verbose. I am unsure of *exact *reproduction steps, but this has happened on 3 individual projects (I can share each json file if you want)

    yes, please share the json files with me via email, shiwei.liang@volosoft.com I will check it.

  • User Avatar
    0
    alboy created

    Hi, thanks for the response. I've responded with a zip of my .suite folder. I await your response!

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I can reproduce the problem. we will fix it in the next patch version

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    The problem is related to that you did not set "show on create modal" for properties. When it's not selected then it's not generated on the related places:

    For a quick workaround, you can check the "show on create modal" option and regenerate the entity, it will be fixed.


    I'll fix this problem asap. BTW, your ticket is refunded. Regards.

  • User Avatar
    0
    alboy created

    Okay, I understand now why the error has occurred, the explanation is much appreciated! I'll implement the workaround and deal with it for now.

    Just for clarity, and in case you want insight into my reasoning behind why I did this, the reason it's ticked off is because of changes made in the templates I sent you. I wanted to add custom controls on the create/update modals. So I edited the templates to add custom code hooks in between each field, allowing me to customize the property fields on the modals etc. This way I can have lots of fancy interactive fields to create my entities, for example, for a name property on a given entity I might have an icon button to the right of the field to generate a random name, or a button to test a connection string etc.

    Thanks again for your quick response

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06