Skip to content

Implement setting column resolution - #161

Open
pxpm wants to merge 7 commits into
mainfrom
implement-setting-column-resolution
Open

Implement setting column resolution#161
pxpm wants to merge 7 commits into
mainfrom
implement-setting-column-resolution

Conversation

@pxpm

@pxpm pxpm commented May 29, 2026

Copy link
Copy Markdown
Contributor

The datetime column was ignoring the format option because the list view was rendering setting values as plain text, regardless of the field type. This PR makes the value column actually respect the field definition.

What changed:

  • New setting_value column that dispatches each row to the correct Backpack column view based on its field type (so datetime fields render as dates, checkbox as booleans, upload as images, etc.).
  • New optional column DB field on the settings table, for cases where you want the display to differ from the edit form (e.g. add a prefix/suffix, use a different column type).
  • A FieldToColumnResolver that translates a field definition into a column definition. Blacklists form-only keys (validation, attributes, view_namespace, ...) and lets everything else through, so new column types in future Backpack releases work without changes here.
  • An UploaderColumnHydrator so withFiles / withMedia columns resolve stored paths to URLs per-row (can't use the macro's global retrieved event here — every Setting row shares the same model + value attribute, last uploader would win).

BC:
Off by default. Set auto_resolve_columns => true in the published config to opt in. Existing installs see no change until they publish the new migration and flip the flag. Planning to default it to true in the next major.

Tests: 31 new tests covering the resolver and the hydrator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants