JayGee Posted December 6 Share Posted December 6 I'm building a custom module for project that will leverage LazyCron. I can't seem to find how you tell your module that LazyCron is required? I've tried adding the following to my getModuleInfo() 'requires' => [ 'LazyCron' ], and have also tried adding the following that ChatGPT suggested... but not sure if it has made up this syntax as I've not seen it before?! 'requires' => [ 'ProcessWire:LazyCron' ], Either way I get the error: ProcessModule: Error reported by web service: That module is not currently tracked by the modules directory In an ideal world I'd just enable the core module from my own module, is this possible? Link to comment Share on other sites More sharing options...
bernhard Posted December 6 Share Posted December 6 1 hour ago, JayGee said: In an ideal world I'd just enable the core module from my own module, is this possible? You just need to call wire()->modules->get('LazyCron') somewhere in your module, then LazyCron will automatically be installed. 1 1 Link to comment Share on other sites More sharing options...
wbmnfktr Posted December 6 Share Posted December 6 Let's have a look here in the docs: <?php public static function getModuleInfo() { return array( 'title' => 'Hello World', 'version' => 101, 'author' => 'Ryan Cramer', 'summary' => 'Just an example', 'requires' => array("LazyCron", "AdminBar") // added this line ); ); 1 Link to comment Share on other sites More sharing options...
JayGee Posted December 9 Author Share Posted December 9 On 12/6/2024 at 12:58 PM, bernhard said: You just need to call wire()->modules->get('LazyCron') somewhere in your module, then LazyCron will automatically be installed. Nice thanks @bernhard - never realised it was that simple. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now