Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 979
    • Issues 979
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • Core
  • Issues
  • #2134

Closed
Open
Opened Oct 19, 2020 by xavier@xavierDeveloper

Order of custom groups not correct

Overview

When editing a case, the order of custom groups isn't correct (doesn't respect weight)

Reproduction steps

  1. Create a new custom group for a case "second"
  2. Create a new custom group for a case "first"
  3. change the order (weight) so "first" is before "second"
  4. create a new case

Current behaviour

the custom groups are sorted by id, not by weight

Expected behaviour

The custom groups are sorted by weight

Environment information

Out of the box normal civi. Do you want me to create a test case on demo?

Comments

I spent a few hours drilling through the code, getTree (CRM/Core/BAO/CustomGroup.php) returns the groups properly sorted

but groupTree in templates/CRM/Custom/Form/CustomData.tpl isn't ;(

in CRM/Core/BAO/CustomGroup.php::buildQuickForm $groupTree is correct (with the correct order)

but $form->assign_by_ref("{$prefix}groupTree", $groupTree);

ends up with the groupTree being re-ordered in smarty?

I'm a bit confused as when the order of the custom block is defined, but I'm pretty keen on having it respecting the weight/sort order ;)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#2134