Skip to content

Can't sort repeater elements #70

@stefan-scholl

Description

@stefan-scholl

Short description of the issue

Can't sort elements of a repeater as described here: https://processwire.com/talk/topic/1674-sorting-repeater/#comment-15457

Expected behavior

I need new elements to be at the end by sorting them by "created".

Actual behavior

Sorts according to "sort".

See https://github.com/processwire/processwire/blob/3.0.36/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module#L627

When deleting elements in between and adding new ones you get a sort number lower than the highest sort number. That's why the newest entries aren't at the end.

Optional: Suggestion for a possible fix

Use the sorting set in the (system) template of the repeater. As described in the forum 2012.

Steps to reproduce the issue

  1. Fill Repeater with multiple items. Save.
  2. Delete items before the last one. Save.
  3. Enter new item. Save.
  4. See the new item isn't the last in the list.

Setup/Environment

  • ProcessWire version: 3.0.36

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions