Skip to content

Commit dacd089

Browse files
committed
- fixed problems with missing tables and fields
1 parent 3d7a500 commit dacd089

6 files changed

Lines changed: 15 additions & 10 deletions

File tree

class/Files/CreateArchitecture.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ public function setFilesToBuilding($module)
553553
}
554554
}
555555
// Creation of sql file
556-
if (null != $table->getVar('table_name')) {
556+
if (\count($tables) > 0) {
557557
// Sql File
558558
$sqlFile = Modulebuilder\Files\Sql\SqlFile::getInstance();
559559
$sqlFile->write($module, 'mysql.sql');

class/Files/CreateStructure.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function isDir($dname)
175175
*/
176176
protected function makeDir($dir)
177177
{
178-
$this->isDir(\trim($dir));
178+
$this->isDir(\mb_strtolower(\trim($dir)));
179179
}
180180

181181
/**

class/Files/Includes/IncludeCommon.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,12 @@ private function getCommonCode($module)
128128
$ret .= $this->getCommonDefines($moduleDirname, 'UPLOAD_PATH', "XOOPS_UPLOAD_PATH . '/' . {$stuModuleDirname}_DIRNAME");
129129
$ret .= $this->getCommonDefines($moduleDirname, 'UPLOAD_URL', "XOOPS_UPLOAD_URL . '/' . {$stuModuleDirname}_DIRNAME");
130130

131-
$fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
132-
$fieldElement = [];
133-
foreach (\array_keys($fields) as $f) {
134-
$fieldElement[] = $fields[$f]->getVar('field_element');
131+
if (\is_object($table)) {
132+
$fields = $this->getTableFields($table->getVar('table_mid'), $table->getVar('table_id'));
133+
$fieldElement = [];
134+
foreach (\array_keys($fields) as $f) {
135+
$fieldElement[] = $fields[$f]->getVar('field_element');
136+
}
135137
}
136138
$ret .= $this->getCommonDefines($moduleDirname, 'UPLOAD_FILES_PATH', "{$stuModuleDirname}_UPLOAD_PATH . '/files'");
137139
$ret .= $this->getCommonDefines($moduleDirname, 'UPLOAD_FILES_URL', "{$stuModuleDirname}_UPLOAD_URL . '/files'");

class/Files/Includes/IncludeFunctions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,9 @@ public function render()
401401
$tableId = null;
402402
$tableMid = null;
403403
$tableName = null;
404-
$tableBlocks = null;
405-
$tablePermissions = null;
406-
$tableCategory = null;
404+
$tableBlocks = [];
405+
$tablePermissions = [];
406+
$tableCategory = [];
407407
foreach (\array_keys($tables) as $i) {
408408
$tableId = $tables[$i]->getVar('table_id');
409409
$tableMid = $tables[$i]->getVar('table_mid');

class/Files/User/UserXoopsVersion.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,9 @@ public function render()
11661166
$content = $this->getHeaderFilesComments($module);
11671167
$content .= $this->getXoopsVersionHeader($module, $language);
11681168
$content .= $this->getXoopsVersionTemplatesAdminUser($moduleDirname, $tables, $module->getVar('mod_admin'), $module->getVar('mod_user'));
1169-
$content .= $this->getXoopsVersionMySQL($moduleDirname, $table, $tables);
1169+
if (\count($tables) > 0) {
1170+
$content .= $this->getXoopsVersionMySQL($moduleDirname, $table, $tables);
1171+
}
11701172
$tableSearch = [];
11711173
$tableComments = [];
11721174
$tableSubmenu = [];

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- added uuid and IP textbox field (mamba/goffy)
77
- fixed problem with missing empy.png (cesagonchu/goffy)
88
- fixed bug with mb_strtolower for dir creation (cesagonchu/goffy)
9+
- fixed problems with missing tables and fields (cesagonchu/goffy)
910

1011
<h5>3.04 Alpha 1 [2020-06-12]</h5> Dev: XOOPS 2.5.11, PHP 7.4.5
1112
<hr>

0 commit comments

Comments
 (0)