summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-22 13:32:59 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-22 13:32:59 +0100
commit0186c01d4ddbcbf91631b1f300ab9021c52141f7 (patch)
tree88721334ffcbf83ce62dbf52235b4359772689bc
parent6307cd31602101a2c6416244f2f7703be920f1df (diff)
downloadinstall-0186c01d4ddbcbf91631b1f300ab9021c52141f7.tar.gz
install-0186c01d4ddbcbf91631b1f300ab9021c52141f7.tar.bz2
install-0186c01d4ddbcbf91631b1f300ab9021c52141f7.zip
Fix integrity check page: working 'try to add table' and 'show table details'
Reuse existing DB connection (mDb->mDb) instead of opening a redundant new ADOdb connection that fails silently on Firebird PDO. Also fix JS namespace backslash in toggleElementDisplay call that broke the show-table-details link. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
-rwxr-xr-xincludes/install_cleanup.php40
-rwxr-xr-xtemplates/install_cleanup.tpl2
2 files changed, 18 insertions, 24 deletions
diff --git a/includes/install_cleanup.php b/includes/install_cleanup.php
index dc2d642..eb8645d 100755
--- a/includes/install_cleanup.php
+++ b/includes/install_cleanup.php
@@ -88,33 +88,27 @@ if( !empty( $gLibertySystem->mServices ) ) {
// ===================== Process Form =====================
// create missing tables if possible
if (!empty( $_REQUEST['create_tables'] ) && !empty( $dbIntegrity )) {
- $gBitInstallDb = ADONewConnection( $gBitDbType );
+ $dict = NewDataDictionary( $gBitInstaller->mDb->mDb, 'firebird' );
- if ($gBitInstallDb->Connect( $gBitDbHost, $gBitDbUser, $gBitDbPassword, $gBitDbType != 'pdo' ? $gBitDbName : NULL )) {
- $dict = NewDataDictionary( $gBitInstallDb, 'firebird' );
-
- if (!$gBitInstaller->mDb->getCaseSensitivity()) {
- $dict->connection->nameQuote = '';
- }
+ if (!$gBitInstaller->mDb->getCaseSensitivity()) {
+ $dict->connection->nameQuote = '';
+ }
- if (!empty( $gDebug ) || !empty( $_REQUEST['debug'] )) {
- $gBitInstallDb->debug = 99;
- }
+ if (!empty( $gDebug ) || !empty( $_REQUEST['debug'] )) {
+ $gBitInstaller->mDb->mDb->debug = 99;
+ }
- // If we use MySql check which storage engine to use
- $build = isset( $_SESSION['use_innodb'] )
- ? ( ( $_SESSION['use_innodb'] == true ) ? [ 'NEW', 'MYSQL' => 'ENGINE=INNODB' ] : [ 'NEW', 'MYSQL' => 'ENGINE=MYISAM' ] ) : 'NEW';
+ // If we use MySql check which storage engine to use
+ $build = isset( $_SESSION['use_innodb'] )
+ ? ( ( $_SESSION['use_innodb'] == true ) ? [ 'NEW', 'MYSQL' => 'ENGINE=INNODB' ] : [ 'NEW', 'MYSQL' => 'ENGINE=MYISAM' ] ) : 'NEW';
- $tablePrefix = $gBitInstaller->getTablePrefix();
- foreach( $dbIntegrity as $package => $info ) {
- foreach( $info['tables'] as $table ) {
- $completeTableName = $tablePrefix.$table['name'];
- $sql = $dict->CreateTableSQL( $completeTableName, $gBitInstaller->mPackages[$package]['tables'][$table['name']], $build );
- // Uncomment this line to see the create sql
- //vd( $sql );
- if( $sql ) {
- $dict->ExecuteSQLArray( $sql );
- }
+ $tablePrefix = $gBitInstaller->getTablePrefix();
+ foreach( $dbIntegrity as $package => $info ) {
+ foreach( $info['tables'] as $table ) {
+ $completeTableName = $tablePrefix.$table['name'];
+ $sql = $dict->CreateTableSQL( $completeTableName, $gBitInstaller->mPackages[$package]['tables'][$table['name']], $build );
+ if( $sql ) {
+ $dict->ExecuteSQLArray( $sql );
}
}
}
diff --git a/templates/install_cleanup.tpl b/templates/install_cleanup.tpl
index 30aa167..6fa1093 100755
--- a/templates/install_cleanup.tpl
+++ b/templates/install_cleanup.tpl
@@ -25,7 +25,7 @@
<ul>
{foreach from=$package.tables item=table}
<li>
- <a style="float:right" href="#" onclick="\Bitweaver\BitBase.toggleElementDisplay('{$table.name}','block');return false">show table details</a> {$table.name}<br />
+ <a style="float:right" href="#" onclick="BitBase.toggleElementDisplay('{$table.name}','block');return false">show table details</a> {$table.name}<br />
<div id="{$table.name}" style="display:none;">
<code>{$table.sql|nl2br}</code>
</div>