bernhard Posted January 10, 2019 Share Posted January 10, 2019 Hi everybody, today I had a very hard time with the LanguageSupport module ? I tried a lot, but I can't get it to install via the API: I've tried this: $this->modules->install('LanguageSupport', ['force' => true]); And this: require_once($this->config->paths->modules . 'LanguageSupport/LanguageSupportInstall.php'); $ls = $this->wire(new LanguageSupportInstall()); $ls->install(); Both execute without an error, but when I visit the modules page, I get this: No matter what I try, it will not install ? The weird thing is: If I install it manually by clicking the button, it works as expected. Am I missing anything? I'm actually not doing anything different from here: https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessModule/ProcessModule.module#L261-L275 (at least I think so) Help would be greatly appreciated! Thx Link to comment Share on other sites More sharing options...
adrian Posted January 10, 2019 Share Posted January 10, 2019 Hey @bernhard - not sure but this is how I do it in the Migrator module: https://github.com/adrianbj/ProcessMigrator/blob/eaf8255aded36033bcd468c59b235b9a0eb6b785/ProcessMigrator.module#L990 Not sure if "get" vs "install" works a little differently or not - been a while since I worked with this. 1 Link to comment Share on other sites More sharing options...
teppo Posted January 10, 2019 Share Posted January 10, 2019 Here's another example from the VersionControlTests package: https://github.com/teppokoivula/VersionControlTests/blob/master/tests/VersionControlTest.php#L170:L179. It's in a PHPUnit test class so the syntax is a bit strange, but at least the last time I ran the tests this worked (though that was against PW 2.x.) 1 Link to comment Share on other sites More sharing options...
bernhard Posted January 10, 2019 Author Share Posted January 10, 2019 Thank you guys! Turns out that something in my database was messed up. I did a restore and $modules->install() is working as expected! 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