fix original module name et dc min in dcstore

master
Jean-Christian Paul Denis 2021-09-06 23:33:47 +02:00
parent df0222b6f5
commit 3f7347f031
1 changed files with 13 additions and 3 deletions

View File

@ -80,7 +80,6 @@ class ImproveActionDcstore extends ImproveAction
if (!is_array($module) || empty($module)) { if (!is_array($module) || empty($module)) {
return false; return false;
} }
$module = Improve::sanitizeModule($id, $module);
$xml = ['<modules xmlns:da="http://dotaddict.org/da/">']; $xml = ['<modules xmlns:da="http://dotaddict.org/da/">'];
@ -91,7 +90,7 @@ class ImproveActionDcstore extends ImproveAction
$xml[] = sprintf('<module id="%s">', html::escapeHTML($module['id'])); $xml[] = sprintf('<module id="%s">', html::escapeHTML($module['id']));
# name # name
if (empty($module['name'])) { if (empty($module['oname'])) {
self::notice(__('unknow module name')); self::notice(__('unknow module name'));
} }
$xml[] = sprintf('<name>%s</name>', html::escapeHTML($module['name'])); $xml[] = sprintf('<name>%s</name>', html::escapeHTML($module['name']));
@ -127,7 +126,18 @@ class ImproveActionDcstore extends ImproveAction
} }
$xml[] = sprintf('<file>%s</file>', html::escapeHTML($file_pattern)); $xml[] = sprintf('<file>%s</file>', html::escapeHTML($file_pattern));
# da dc_min # da dc_min or requires core
if (!empty($module['requires']) && is_array($module['requires'])) {
foreach ($module['requires'] as $req) {
if (!is_array($req)) {
$req = [$req];
}
if ($req[0] == 'core') {
$module['dc_min'] = $req[1];
break;
}
}
}
if (empty($module['dc_min'])) { if (empty($module['dc_min'])) {
self::notice(__('no minimum dotclear version'), false); self::notice(__('no minimum dotclear version'), false);
} else { } else {