Skip to content

Conversation

ojnadjarm
Copy link

This PR add the posibility to add custom subplugins on the custom folder. That way ppl can generate it's own steps, without modifying the plugin, also the custom course field are now supported.

@dmitriim
Copy link
Member

dmitriim commented Aug 11, 2025

hi @ojnadjarm

Thanks for this PR. I like the idea and this 100% will make the plugin more flexible.

In our plugins we started to go away from subplugins structure as it's not necessary in most of the cases as well as it reduces an amount of boilerplate code around subplugins (like version, lang strings, privacy and etc). Instead we either use hooks/callback to get appropriate classes from other plugins (so we expect a plugin to implement a callback in lib.php or subscribe to a custom hook and provide implementation of specific classes) or just discover appropriate classes from all auto-loaded classes (which is easier IMHO),

See an example of latter here https://github.com/catalyst/moodle-tool_dynamic_cohorts?tab=readme-ov-file#technical-details -> https://github.com/catalyst/moodle-tool_dynamic_cohorts/blob/MOODLE_404_STABLE/classes/condition_manager.php#L39

Wouldn't you mind to rework your code using the same approach + document it all in README of the plugin?

@dmitriim dmitriim assigned dmitriim and unassigned dmitriim Aug 11, 2025
@dmitriim dmitriim self-requested a review August 11, 2025 23:14
@dmitriim
Copy link
Member

@ojnadjarm also would be nice to split this PR into two - one for course fields and the second one for "subplugins". Thanks in advance.

Issue for course custom fields #104

Issue for "subplugin" extension #243

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.

4 participants