From fce9165a2c279a7be188b0b13310c6e2c8c90642 Mon Sep 17 00:00:00 2001 From: Alperen Samurlu Date: Thu, 20 Nov 2025 14:54:20 +0300 Subject: [PATCH] Make rating modal IDs unique per entity Generates unique modal and label IDs for the rating detail modal based on entity type and ID, preventing conflicts when multiple rating components are rendered on the same page. --- .../CmsKit/Shared/Components/Rating/Default.cshtml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Rating/Default.cshtml b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Rating/Default.cshtml index 9ce4632856..0c0a1dc8f5 100644 --- a/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Rating/Default.cshtml +++ b/modules/cms-kit/src/Volo.CmsKit.Public.Web/Pages/CmsKit/Shared/Components/Rating/Default.cshtml @@ -5,6 +5,12 @@ @model Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Rating.RatingViewModel @inject IHtmlLocalizer L +@{ + var modalId = "ratingDetail_" + Model.EntityType + "_" + Model.EntityId; + modalId = modalId.Replace(".", "-").Replace(":", "-").Replace("/", "-").Replace(" ", "-"); + var modalLabelId = modalId + "_label"; +} +
@@ -13,15 +19,15 @@ { @if (Model.Ratings != null) { - + -