Skip to content

DEV: Use model extension APIs instead of modifyClass - #169

Open
cvx wants to merge 1 commit into
angusmcleod:mainfrom
cvx:model-apis
Open

cvx wants to merge 1 commit into
angusmcleod:mainfrom
cvx:model-apis

Conversation

@cvx

@cvx cvx commented Aug 3, 2026

Copy link
Copy Markdown

modifyClass("model:*", ...); is being deprecated so this PR replaces the model:composer, model:topic and model:site-setting overrides with the granular model extension APIs: showEventControls, canCreateEvent and topicListItemClasses become addModelGetter, and the allowsNone override becomes the site-setting-allows-none value transformer.

Replaces the `model:composer`, `model:topic` and `model:site-setting`
overrides with the granular model extension APIs: `showEventControls`,
`canCreateEvent` and `topicListItemClasses` become `addModelGetter`, and the
`allowsNone` override becomes the `site-setting-allows-none` value transformer.

The transformer also fixes a latent bug: the original `allowsNone` had no
`return` in its `else` branch, so it returned `undefined` for every other
setting whenever an admin had the plugin enabled.

The remaining `modifyClass` calls target components, controllers, routes and a
service, which are out of scope for the model APIs.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant