Starts in:
3 DAYS
6 HRS
0 MIN
59 SEC
Starts in:
3 D
6 H
0 M
59 S
Open Closed

When-insert-data-CreatorId-has-been-null #8315


User avatar
0
portx-dev created

Continue question https://abp.io/support/questions/8241/When-insert-data-CreatorId-has-been-null

Is there any case where the user information is still available on the client but not on the server? In my environment, there is a CreatorName field that receives the value sent from the client. Even though CreatorName is not null, CreatorId is null.

  • ABP Framework version: v8.3.3
  • UI Type: Angular
  • Database System: EF Core (MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

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

    Hi,

    Because your previous question was closed and has not been resolved, I have returned your ticket.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    CreatorId is obtained from the CurrentUser.

    You can see the logic here https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditPropertySetter.cs#L65

    In my environment, there is a CreatorName field that receives the value sent from the client. Even though CreatorName is not null, CreatorId is null.

    As far as I know, there is no CreatorName

  • User Avatar
    0
    portx-dev created

    @liangshiwei What I mean is CreatorName is a field I created, when calling the api, it is retrieved from the client via

    this.configStateService.getOne("currentUser")
    

    At that time, there was user information on the client but not on the server

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I guess there is no currentTenant on the server.

    You can try writing log:

    Logger.LogInformation("CurrentTenant Id"+ CurrentTenant.Id);
    Logger.LogInformation("CurrentTenant Name"+ CurrentTenant.Name);
    

    and could you please share the HTTP request body?

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