silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
719 stars 820 forks source link

Form scaffolder should keep original field order #11160

Closed lekoala closed 4 months ago

lekoala commented 4 months ago

Description

In the current state of things, extensions db fields are prepended instead of appended (see https://github.com/silverstripe/silverstripe-config/issues/110). Since the form scaffolder loops over the config()->db value, base object fields are not at the top.

Typically, on a member, you want to have the firstname, surname, email... as the first fields appearing.

I propose to make a small adjustement to the scaffolder so that fields are ordered properly

Additional context or points of discussion

No response

Validations

lekoala commented 4 months ago

I've made a pull request since i think it makes sense to have this baked in the core, but otherwise, creating your own extension of the formscaffolder works equally well, so it's up to the team to see if that's a helpful addition or not

GuySartorelli commented 4 months ago

This ultimately, as you pointed out, is a result of https://github.com/silverstripe/silverstripe-config/issues/110 If you want to tackle that issue for CMS 6 I'd be happy with that approach, but I don't think we should be working around the order that config is added.