1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-16 11:44:42 +02:00
This commit is contained in:
Ryan Cramer
2023-08-04 11:39:52 -04:00
parent d6a0df74d6
commit 044175df04
2 changed files with 8 additions and 9 deletions

View File

@@ -11,7 +11,7 @@
* This version also lifts several pieces of code from Soma's Modules Manager
* specific to the parts involved with downloading modules from the directory.
*
* ProcessWire 3.x, Copyright 2022 by Ryan Cramer
* ProcessWire 3.x, Copyright 2023 by Ryan Cramer
* https://processwire.com
*
* @todo add support for module configuration inputfields with useLanguages option
@@ -1294,7 +1294,7 @@ class ProcessModule extends Process {
$destinationDir = $this->wire()->config->paths->siteModules . $className . '/';
$completedDir = $this->installer()->downloadModule($url, $destinationDir);
$completedDir = $this->installer()->downloadModuleFromDirectory($url, $destinationDir);
if($completedDir) {
return $this->buildDownloadSuccessForm($className)->render();
} else {
@@ -1510,7 +1510,7 @@ class ProcessModule extends Process {
if(!$user->isSuperuser()) throw new WirePermissionException('Superuser required');
if(!$config->advanced) throw new WireException('This feature requires config.advanced=true;');
$moduleData = $modules->getModuleConfigData($moduleName);
$moduleData = $modules->getConfig($moduleName);
$sinfo = self::getModuleInfo();
$this->headline(sprintf($this->_('%s raw config data'), $moduleName));
@@ -1771,7 +1771,7 @@ class ProcessModule extends Process {
if($languages && $fields) {
// multi-language support for Inputfield with useLanguages==true
// we populate the language values from module config data so module doesn't have to do this
$data = $modules->getModuleConfigData($moduleName);
$data = $modules->getConfig($moduleName);
foreach($fields->getAll() as $field) {
if(!$field->getSetting('useLanguages')) continue;
foreach($languages as $language) {
@@ -1789,7 +1789,7 @@ class ProcessModule extends Process {
// check for submitted form
if($submitSave) {
if(is_null($data)) $data = $modules->getModuleConfigData($moduleName);
if(is_null($data)) $data = $modules->getConfig($moduleName);
$form->processInput($input->post);
$updatedNames = array();

View File

@@ -167,7 +167,7 @@ class ProcessModuleInstall extends Wire {
if(!$modulePath) $modulePath = $this->wire()->config->paths->siteModules;
$tempDir = $this->getTempDir();
foreach($files as $key => $f) {
foreach($files as $f) {
// determine which file should be responsible for the name
if(strpos($f, '/') !== false) {
$dir = dirname($f);
@@ -454,7 +454,7 @@ class ProcessModuleInstall extends Wire {
if(count($files)) {
$file = $tempDir . reset($files);
$destinationDir = $this->unzipModule($file, $destinationDir);
if($destinationDir) $this->modules->resetCache();
if($destinationDir) $this->modules->refresh();
} else {
$this->error($this->_('No uploads found'));
@@ -502,7 +502,7 @@ class ProcessModuleInstall extends Wire {
$destinationDir = $this->unzipModule($file, $destinationDir);
if($destinationDir) {
$success = true;
$this->modules->resetCache();
$this->modules->refresh();
}
} catch(\Exception $e) {
@@ -576,4 +576,3 @@ class ProcessModuleInstall extends Wire {
}
}