Open Closed

Many to Many navigation error while deleting - may be bug #6755


User avatar
0
Navneet@aol.com.au created

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:

  • ABP Framework version: v8.0.4
  • UI Type: Angular / MVC / Blazor WASM / Blazor Server
  • Database System: MySQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:

Hello Team,

I am getting error while deleting items from Many to Many popup box. Looks like it is bug. After debugging I believe it is failing at

UI guide to produce error Delete one item Click on save

  • Steps to reproduce the issue:
  1. Create a new Module application from ABP suite
  2. Create two entity and N-N navigation.
  3. Below I have copy past my two suite entities if you want to use
  4. Use Host --> Web.Unified to do migration and run the application

ProductVersion.json

{
  "Id": "c9c0e8de-7201-48ad-985c-a15ea7a27a54",
  "Name": "ProductVersion",
  "OriginalName": "ProductVersion",
  "NamePlural": "ProductVersions",
  "DatabaseTableName": "ProductVersions",
  "Namespace": "ProductVersions",
  "Type": 1,
  "MasterEntityName": null,
  "MasterEntity": null,
  "BaseClass": "FullAuditedAggregateRoot",
  "MenuIcon": "file-alt",
  "PrimaryKeyType": "Guid",
  "PreserveCustomCode": true,
  "IsMultiTenant": true,
  "CheckConcurrency": true,
  "ShouldCreateUserInterface": true,
  "ShouldCreateBackend": true,
  "ShouldExportExcel": false,
  "ShouldAddMigration": true,
  "ShouldUpdateDatabase": true,
  "CreateTests": false,
  "Properties": [
    {
      "Id": "a25033bf-ace9-48ac-b85b-0ca1b46aa93f",
      "Name": "VersionName",
      "Type": "string",
      "EnumType": "",
      "EnumNamespace": "",
      "EnumAngularImport": "shared/enums",
      "EnumFilePath": null,
      "DefaultValue": null,
      "IsNullable": false,
      "IsRequired": false,
      "AllowEmptyStrings": false,
      "IsTextArea": false,
      "MinLength": null,
      "MaxLength": null,
      "SortOrder": 0,
      "SortType": 0,
      "Regex": "",
      "EmailValidation": false,
      "ShowOnList": true,
      "ShowOnCreateModal": true,
      "ShowOnEditModal": true,
      "ReadonlyOnEditModal": false,
      "EnumValues": null,
      "IsSelected": true,
      "OrdinalIndex": 0
    },
    {
      "Id": "1caed050-5639-4702-967e-7802e0772fbc",
      "Name": "IsActive",
      "Type": "bool",
      "EnumType": "",
      "EnumNamespace": "",
      "EnumAngularImport": "shared/enums",
      "EnumFilePath": null,
      "DefaultValue": "true",
      "IsNullable": false,
      "IsRequired": false,
      "AllowEmptyStrings": false,
      "IsTextArea": false,
      "MinLength": null,
      "MaxLength": null,
      "SortOrder": 0,
      "SortType": 0,
      "Regex": "",
      "EmailValidation": false,
      "ShowOnList": true,
      "ShowOnCreateModal": true,
      "ShowOnEditModal": true,
      "ReadonlyOnEditModal": false,
      "EnumValues": null,
      "IsSelected": true,
      "OrdinalIndex": 0
    },
    {
      "Id": "902ce3e5-44df-4155-8e2f-f29db8b207bf",
      "Name": "VersionNumber",
      "Type": "string",
      "EnumType": "",
      "EnumNamespace": "",
      "EnumAngularImport": "shared/enums",
      "EnumFilePath": null,
      "DefaultValue": null,
      "IsNullable": false,
      "IsRequired": false,
      "AllowEmptyStrings": false,
      "IsTextArea": false,
      "MinLength": null,
      "MaxLength": null,
      "SortOrder": 0,
      "SortType": 0,
      "Regex": "",
      "EmailValidation": false,
      "ShowOnList": true,
      "ShowOnCreateModal": true,
      "ShowOnEditModal": true,
      "ReadonlyOnEditModal": false,
      "EnumValues": null,
      "IsSelected": true,
      "OrdinalIndex": 0
    }
  ],
  "NavigationProperties": [],
  "NavigationConnections": [],
  "ChildEntities": [],
  "PhysicalFileName": "ProductVersion.json"
}

ProductFeature.json

{
  "Id": "473fe992-54e4-41d8-978a-a26be9ea5bb3",
  "Name": "ProductFeature",
  "OriginalName": "ProductFeature",
  "NamePlural": "ProductFeatures",
  "DatabaseTableName": "ProductFeatures",
  "Namespace": "ProductFeatures",
  "Type": 1,
  "MasterEntityName": null,
  "MasterEntity": null,
  "BaseClass": "FullAuditedAggregateRoot",
  "MenuIcon": "file-alt",
  "PrimaryKeyType": "Guid",
  "PreserveCustomCode": true,
  "IsMultiTenant": true,
  "CheckConcurrency": true,
  "ShouldCreateUserInterface": true,
  "ShouldCreateBackend": true,
  "ShouldExportExcel": false,
  "ShouldAddMigration": true,
  "ShouldUpdateDatabase": true,
  "CreateTests": false,
  "Properties": [
    {
      "Id": "7ada5c2a-14d7-44d5-b115-ed2666e2fc8e",
      "Name": "FeatureName",
      "Type": "string",
      "EnumType": "",
      "EnumNamespace": "",
      "EnumAngularImport": "shared/enums",
      "EnumFilePath": null,
      "DefaultValue": null,
      "IsNullable": false,
      "IsRequired": false,
      "AllowEmptyStrings": false,
      "IsTextArea": false,
      "MinLength": null,
      "MaxLength": null,
      "SortOrder": 0,
      "SortType": 0,
      "Regex": "",
      "EmailValidation": false,
      "ShowOnList": true,
      "ShowOnCreateModal": true,
      "ShowOnEditModal": true,
      "ReadonlyOnEditModal": false,
      "EnumValues": null,
      "IsSelected": true,
      "OrdinalIndex": 0
    },
    {
      "Id": "17a84907-6f5b-4104-a063-626fed74c59e",
      "Name": "IsActive",
      "Type": "bool",
      "EnumType": "",
      "EnumNamespace": "",
      "EnumAngularImport": "shared/enums",
      "EnumFilePath": null,
      "DefaultValue": "true",
      "IsNullable": false,
      "IsRequired": false,
      "AllowEmptyStrings": false,
      "IsTextArea": false,
      "MinLength": null,
      "MaxLength": null,
      "SortOrder": 0,
      "SortType": 0,
      "Regex": "",
      "EmailValidation": false,
      "ShowOnList": true,
      "ShowOnCreateModal": true,
      "ShowOnEditModal": true,
      "ReadonlyOnEditModal": false,
      "EnumValues": null,
      "IsSelected": true,
      "OrdinalIndex": 0
    }
  ],
  "NavigationProperties": [],
  "NavigationConnections": [
    {
      "Name": "ProductVersions",
      "DisplayProperty": "VersionName",
      "Namespace": "ABP.IO.Test.ProductVersions",
      "EntityName": "ProductVersion",
      "EntitySetName": "ProductVersions",
      "DtoNamespace": "ABP.IO.Test.ProductVersions",
      "DtoEntityName": "ProductVersionDto",
      "Type": "Guid"
    }
  ],
  "ChildEntities": [],
  "PhysicalFileName": "ProductFeature.json"
}

Thanks Nav


4 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the logs of this error.

    Btw we have changed the OnDelete(DeleteBehavior(DeleteBehavior.NoAction) to OnDelete(DeleteBehavior.Cascade)

    If you have similar code you can change it.

  • User Avatar
    0
    Navneet@aol.com.au created

    hi

    Please share the logs of this error.

    Btw we have changed the OnDelete(DeleteBehavior(DeleteBehavior.NoAction) to OnDelete(DeleteBehavior.Cascade)

    If you have similar code you can change it.

    Hi maliming,

    You are correct the default template had OnDelete(DeleteBehavior(DeleteBehavior.NoAction), once I change it to OnDelete(DeleteBehavior.Cascade), eveything is working perfectly.

    When can we expect this to be fixed?

    Also, can you please refund the ticket?

    Thanks

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    We fixed this >= 8.1.0, your ticket has been refunded.

  • User Avatar
    0
    Navneet@aol.com.au created

    Hi Maliming,

    Many thx for your help. Enjoy rest of your day

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35