dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
860 stars 468 forks source link

Relationship fields not respecting the order identifiers are sent via the workflow API #26439

Closed swicken-dotcms closed 9 months ago

swicken-dotcms commented 1 year ago

Parent Issue

No response

Problem Statement

When attempting to fire a workflow action that establishes relationships to multiple items in a single field, the resulting contentlet has the items ordered differently from the received order.

Relationship ordering matters, as relationships are pulled back in order, so the results of an API call should be the provided ordering.

Steps to Reproduce

  1. Start up the demo starter
  2. Create a content type called Ordering Test with a Title field and a relationship field called Images that is a Many to many relationship to the Images content type
  3. Fire a call to /api/v1/workflow/actions/default/fire/PUBLISH with the following body:
    {
    "contentlet": {
    "contentType": "OrderingTest",
    "title": "Test",
    "images": "93ca45e0-06d2-4eef-be1d-79bd6bf0fc99,33e538f3-03de-4007-be64-9eef72e74ba0,b6cf8343-1523-442f-b22f-05faef44d81b,54ae3dcb-e5b3-403b-9356-c7eb8a73a2db,90050998-694e-47d8-8ff6-6af1b9127496,b8e65c6b-0d8d-44d3-bafe-7f911be52db4"
    }
    }
  4. Look at the resulting contentlet, the images will be related but the ordering is incorrect.

Oddly enough the ordering is consistently incorrect, in that it's not in the order received but always orders them the same way on every call.

Acceptance Criteria

Contentlets should be related in the order they are received

dotCMS Version

23.01, 23.09.7

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

Related ticket: https://dotcms.zendesk.com/agent/tickets/113628

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

erickgonzalez commented 11 months ago

Tested also to update existing content, and it's working as it should.

josemejias11 commented 11 months ago

Approved: Tested on master_c511030_SNAPSHOT, Docker, macOS 13.0, FF v113.0