mirror of
https://github.com/processwire/processwire.git
synced 2025-08-21 05:51:41 +02:00
Fix issue processwire/processwire-issues#1492
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
* This version also lifts several pieces of code from Soma's Modules Manager
|
* This version also lifts several pieces of code from Soma's Modules Manager
|
||||||
* specific to the parts involved with downloading modules from the directory.
|
* 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
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* @todo add support for module configuration inputfields with useLanguages option
|
* @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 . '/';
|
$destinationDir = $this->wire()->config->paths->siteModules . $className . '/';
|
||||||
|
|
||||||
$completedDir = $this->installer()->downloadModule($url, $destinationDir);
|
$completedDir = $this->installer()->downloadModuleFromDirectory($url, $destinationDir);
|
||||||
if($completedDir) {
|
if($completedDir) {
|
||||||
return $this->buildDownloadSuccessForm($className)->render();
|
return $this->buildDownloadSuccessForm($className)->render();
|
||||||
} else {
|
} else {
|
||||||
@@ -1510,7 +1510,7 @@ class ProcessModule extends Process {
|
|||||||
if(!$user->isSuperuser()) throw new WirePermissionException('Superuser required');
|
if(!$user->isSuperuser()) throw new WirePermissionException('Superuser required');
|
||||||
if(!$config->advanced) throw new WireException('This feature requires config.advanced=true;');
|
if(!$config->advanced) throw new WireException('This feature requires config.advanced=true;');
|
||||||
|
|
||||||
$moduleData = $modules->getModuleConfigData($moduleName);
|
$moduleData = $modules->getConfig($moduleName);
|
||||||
$sinfo = self::getModuleInfo();
|
$sinfo = self::getModuleInfo();
|
||||||
|
|
||||||
$this->headline(sprintf($this->_('%s raw config data'), $moduleName));
|
$this->headline(sprintf($this->_('%s raw config data'), $moduleName));
|
||||||
@@ -1771,7 +1771,7 @@ class ProcessModule extends Process {
|
|||||||
if($languages && $fields) {
|
if($languages && $fields) {
|
||||||
// multi-language support for Inputfield with useLanguages==true
|
// 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
|
// 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) {
|
foreach($fields->getAll() as $field) {
|
||||||
if(!$field->getSetting('useLanguages')) continue;
|
if(!$field->getSetting('useLanguages')) continue;
|
||||||
foreach($languages as $language) {
|
foreach($languages as $language) {
|
||||||
@@ -1789,7 +1789,7 @@ class ProcessModule extends Process {
|
|||||||
// check for submitted form
|
// check for submitted form
|
||||||
if($submitSave) {
|
if($submitSave) {
|
||||||
|
|
||||||
if(is_null($data)) $data = $modules->getModuleConfigData($moduleName);
|
if(is_null($data)) $data = $modules->getConfig($moduleName);
|
||||||
$form->processInput($input->post);
|
$form->processInput($input->post);
|
||||||
$updatedNames = array();
|
$updatedNames = array();
|
||||||
|
|
||||||
|
@@ -167,7 +167,7 @@ class ProcessModuleInstall extends Wire {
|
|||||||
if(!$modulePath) $modulePath = $this->wire()->config->paths->siteModules;
|
if(!$modulePath) $modulePath = $this->wire()->config->paths->siteModules;
|
||||||
$tempDir = $this->getTempDir();
|
$tempDir = $this->getTempDir();
|
||||||
|
|
||||||
foreach($files as $key => $f) {
|
foreach($files as $f) {
|
||||||
// determine which file should be responsible for the name
|
// determine which file should be responsible for the name
|
||||||
if(strpos($f, '/') !== false) {
|
if(strpos($f, '/') !== false) {
|
||||||
$dir = dirname($f);
|
$dir = dirname($f);
|
||||||
@@ -454,7 +454,7 @@ class ProcessModuleInstall extends Wire {
|
|||||||
if(count($files)) {
|
if(count($files)) {
|
||||||
$file = $tempDir . reset($files);
|
$file = $tempDir . reset($files);
|
||||||
$destinationDir = $this->unzipModule($file, $destinationDir);
|
$destinationDir = $this->unzipModule($file, $destinationDir);
|
||||||
if($destinationDir) $this->modules->resetCache();
|
if($destinationDir) $this->modules->refresh();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->error($this->_('No uploads found'));
|
$this->error($this->_('No uploads found'));
|
||||||
@@ -502,7 +502,7 @@ class ProcessModuleInstall extends Wire {
|
|||||||
$destinationDir = $this->unzipModule($file, $destinationDir);
|
$destinationDir = $this->unzipModule($file, $destinationDir);
|
||||||
if($destinationDir) {
|
if($destinationDir) {
|
||||||
$success = true;
|
$success = true;
|
||||||
$this->modules->resetCache();
|
$this->modules->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
@@ -576,4 +576,3 @@ class ProcessModuleInstall extends Wire {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user