Skip to content

Respect relation items order #2166

@bjnsn

Description

@bjnsn

NOTE: This a duplicate of this (closed) issue that was not submitted with a proper template:
#2134

Informations

  • Node.js version: 10.12.0
  • npm version: 6.4.1
  • Strapi version: 3.0.0-alpha.14.3
  • Database: MongoDB (4.0.0)
  • Operating system: Mac OS 10.13.2

(NOTE: also seeing same behavior on server configured as follows)

  • Node.js version: 9.9.0
  • npm version: 5.6.0
  • Strapi version: 3.0.0-alpha.14.2
  • Database: MongoDB (4.0.0)
  • Operating system: Ubuntu 16.04.4

What is the current behavior?
Relations do not retain ordering on save.

Steps to reproduce the problem

  • Create a new strapi
strapi new testProject3
# (accept defaults)
cd testProject3
strapi start
  • Open admin
  • Create two Content Types (foo & bar), each with a name (string) field.
  • Create a oneToMany relation from bar to foo.
  • Create three foos with name values 'foo1', 'foo2', and 'foo3'
  • Create a bar with name 'bar1'
  • Add each foo to the oneToMany relation in bar1; order them 'foo3', 'foo2', 'foo1'
  • Save bar1
  • Reopen bar1

The oneToMany relation UI now shows items in order 'foo1', 'foo2', 'foo3'.
NOTE: this is also true with many-to-many relations, as shown in these screenshots.

Before save:
screen shot 2018-10-18 at 10 53 16 am

After save:
screen shot 2018-10-18 at 10 53 47 am

What is the expected behavior?
The oneToMany items retain their ordering.

Suggested solutions
None at this point.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: feature requestIssue suggesting a new featureseverity: lowIf the issue only affects a very niche base of users and an easily implemented workaround can solvesource: core:content-managerSource is core/content-manager package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions