catalyst / moodle-tool_abconfig

A way to A/B test config, or slowly turn on config for certain audiences or % of traffic
https://moodle.org/plugins/tool_abconfig
6 stars 4 forks source link

Full stack trace trace is not displayed when using the plugin #58

Closed dmitriim closed 1 year ago

dmitriim commented 1 year ago

steps to replicate:

dmitriim commented 1 year ago

This happens because Moodle sets PHP errors earlier than calls "after_config" hook. see https://github.com/moodle/moodle/blob/master/lib/setup.php#L702

dmitriim commented 1 year ago

Not sure about the best way to fix it. We can simply hardcode setting PHP debugging in the plugin the same way as it's in core. But not sure if this is the best solution. @golenkovm @brendanheywood @Peterburnett @keevan Any ideas?

dmitriim commented 1 year ago

I was able to get it working. The missing bit was forcing debugdeveloper to 1. So following config works as expected.

["CFG,debug,32767","CFG,debugdisplay,1","CFG,debugdeveloper,1","js_header,console.log('Works');"]

brendanheywood commented 1 year ago

I would reopen this and turn it into a documentation task.

dmitriim commented 1 year ago

@Peterburnett came up with an idea to have a specific experiment config for enabling debugging.E.g. DEBUG,1

dmitriim commented 1 year ago

I have created https://github.com/catalyst/moodle-tool_abconfig/issues/59