View Issue Details

IDProjectCategoryView StatusLast Update
0024408mantisbtupgradepublic2018-05-20 07:45
ReporterLucVD Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
PlatformXampOSWindows 
Product Version2.14.0 
Summary0024408: SYSTEM NOTICE: 'Undefined variable: t_sqlarray' in 'C:\xampp\htdocs\mantisbt\admin\install.php' line 977
Description

While executing:
http://localhost/mantisbt/admin/install.php
The above error was raised

After disabling this part of the code the error disapears:

 foreach( $t_sqlarray as $t_sql ) {
     # "CREATE OR REPLACE TRIGGER" statements must end with "END;\n/" for Oracle sqlplus
     if( $f_db_type == 'oci8' && stripos( $t_sql, 'CREATE OR REPLACE TRIGGER' ) === 0 ) {
         $t_sql_end = PHP_EOL . '/';
     } else {
         $t_sql_end = ';';
     }
     echo htmlentities( $t_sql ) . $t_sql_end . PHP_EOL . PHP_EOL;
 } 

EDIT (dregad): fix layout

TagsNo tags attached.
Attached Files

Activities

dregad

dregad

2018-05-08 07:15

developer   ~0059743

This section of the code generates a SQL script to assist in manual creation of the DB schema, so I assume you have checked Print SQL Queries instead of Writing to the Database. Commenting out the foreach loop will prevent any output, which kind of defeats the whole purpose of logging the SQL in the first place, so it's not clear what your intent is.

Can you specify at which schema step the error is triggered (or the last one before that), as well as what settings you entered in the form to launch the installation.

LucVD

LucVD

2018-05-08 09:05

reporter   ~0059744

I was indeed Printing the SQL Queries, to have an idea of what database changes to expect.
I executed a upgrade from 1.2.19 to 2.14 on Windows Xampp with db_type: mysqli

I have attached a screenshot with the same problem on Windosws IIS with db_type: mssqlnative
Where I get the same result.

SystemNotice.PNG (15,994 bytes)   
SystemNotice.PNG (15,994 bytes)   
LucVD

LucVD

2018-05-08 09:27

reporter   ~0059745

As per your comments i concluded it would work if i did not: "Print SQL Queries instead of Writing to the Database".
And it does. So I am happy with this result and leave the database changes for what they are.

dregad

dregad

2018-05-08 11:02

developer   ~0059747

Thanks for the feedback.

It would still be interesting to know what part of the upgrade script is triggering the PHP notice, as I believe that should be fixed. Unfortuntely, I was not able to reproduce the error locally.
Could you maybe re-run your test, after adding

echo "$i - "; 

just before the offending foreach, then let me know the last number printed before the PHP notice, that will be the offending upgrade step.

LucVD

LucVD

2018-05-09 04:40

reporter   ~0059749

I am so sorry, I am unable to reproduce the error.
I tried it with the previous installed code: 2.11.1 and the latest available 2.14
I am breaking my head what I could have changed in the mean time; I restored the database before the upgrade of yesterday.
I now see the SQL Queries that are part of the upgrade path.

dregad

dregad

2018-05-09 06:46

developer   ~0059750

OK, I'll close this then. Feel free to reopen and provide the requested info if you see the error again.