View Issue Details

IDProjectCategoryView StatusLast Update
0011364mantisbtinstallationpublic2012-01-08 11:40
Reporterpetrmatula Assigned Todhx  
PriorityhighSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.2.1 
Target Version1.2.3Fixed in Version1.2.3 
Summary0011364: on installl.php 1.2.0rc2 SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given
Description

on installl.php 1.2.0rc2 SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given

Additional Information

Installing Database
Database Creation Suppressed, SQL Queries follow

CREATE TABLE mantis_config_table (

[..]

ALTER TABLE mantis_bug_table ADD last_updated_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

date_migrate;

SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given
;

ALTER TABLE mantis_bug_table DROP COLUMN date_submitted;

ALTER TABLE mantis_bug_table CHANGE COLUMN date_submitted_int date_submitted INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_table DROP COLUMN due_date;

ALTER TABLE mantis_bug_table CHANGE COLUMN due_date_int due_date INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_table DROP COLUMN last_updated;

ALTER TABLE mantis_bug_table CHANGE COLUMN last_updated_int last_updated INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table ADD last_modified_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table ADD date_submitted_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

date_migrate;

SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given
;

ALTER TABLE mantis_bugnote_table DROP COLUMN last_modified;

ALTER TABLE mantis_bugnote_table CHANGE COLUMN last_modified_int last_modified INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bugnote_table ADD INDEX idx_last_mod (last_modified);

ALTER TABLE mantis_bugnote_table DROP COLUMN date_submitted;

ALTER TABLE mantis_bugnote_table CHANGE COLUMN date_submitted_int date_submitted INTEGER UNSIGNED NOT NULL DEFAULT 1;

ALTER TABLE mantis_bug_file_table ADD date_added_int INTEGER UNSIGNED NOT NULL DEFAULT 1;

date_migrate;

[THIS IS REPEATED SEVERAL TIMES]

Your database has not been created yet. Please create the database, then install the tables and data using the information above before proceeding.

TagsNo tags attached.
Attached Files
instaldb.tar.gz (3,937 bytes)
install.tar.gz (116,991 bytes)

Relationships

has duplicate 0011366 closed on installl 1.2.0rc2 SYSTEM WARNING: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given 
has duplicate 0011367 closed on installl 1.2.0rc2 with mysqli database type SYSTEM WARNING: mysqli_real_escape_string() expects parameter 1 to be mysqli, 
has duplicate 0011368 closed on installl 1.2.0rc2 with mysqli database type SYSTEM WARNING: Invalid argument supplied for foreach() 
has duplicate 0011778 closedatrol Displaying queries is breaking when upgrading from 1.1.8 to 1.2 
has duplicate 0011328 closedatrol on installl.php 1.2.0rc1 SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given 
has duplicate 0010861 closedatrol Showing SQL statements fail when upgrading 
related to 0011524 closeddregad 1.2.0rc2 with MS SQL not installable 

Activities

siebrand

siebrand

2010-01-08 10:18

developer   ~0024106

Shortened the additional information.

petrmatula

petrmatula

2010-01-08 14:26

reporter   ~0024110

When I install 1.2.0rc2 Ihave three SYSTEM WARNINGs
with mysqli database type
SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given
SYSTEM WARNING: Invalid argument supplied for foreach()
SYSTEM WARNING: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given

with mysql database type
only
SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given

petrmatula

petrmatula

2010-01-16 18:37

reporter   ~0024167

After updating php 5.3.0 to php 5.3.1
No changes
I try php 5.2 tomorrow

petrmatula

petrmatula

2010-01-17 12:34

reporter   ~0024181

With php 5.2
No changes
The same warnings

Installation Option Type of Database Mysqli

SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given
SYSTEM WARNING: Invalid argument supplied for foreach()
SYSTEM WARNING: mysqli_real_escape_string() expects parameter 1 to be mysqli, boolean given

Installation Option Type of Database Mysql

SYSTEM WARNING: Invalid argument supplied for foreach()
SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array given

petrmatula

petrmatula

2010-01-17 14:07

reporter   ~0024183

Instalation 1.2.0rc2 on php 5.2
install.tar.gz

petrmatula

petrmatula

2010-01-17 14:09

reporter   ~0024184

I,ve tried to install ver. 1.1.8
with the same warnings

atrol

atrol

2010-01-17 15:02

developer   ~0024185

I think this is caused by enabeling the checkbox "Print SQL Queries instead of Writing to the Database"

atrol

atrol

2010-01-17 15:28

developer   ~0024186

I am no experienced PHP developer, maybe
echo htmlentities( $sql ) . ";\r\n\r\n";
should be
echo htmlentities( implode ( $sql ) ) . ";\r\n\r\n";

yanual

yanual

2010-04-26 05:51

reporter   ~0025262

I have the same problem when I try to install the latest stable version 1.2.1 on my version 1.1.1

ottog

ottog

2010-05-05 10:38

reporter   ~0025406

Hi,

The reason for this problem is that the install.php page tries to print out SQL code for schema-creation directives that are actually intended to trigger the excution of logic coded in PHP. One way or another, the attempt is bound to fail.

What the PHP code does is things like copying data between columns that have had their definitions changed. There is no solution to this except perhaps to express the actions in pure SQL, but that might not be possible in a portable way.

Below is a patch in diff -u format to the 1.2.1 stable version of the admin/install.php file that at least cleans up the output by printing an informative comment instead of letting the error printouts mess up the SQL syntax.

The patch also includes another useful change, by temporarily disabling the error-reporting subsystem, which otherwise wipes out the page content upon errors, so that the administrator cannot see how far the script managed to run before breaking.

--- admin/install.1.2.1.php 2010-05-05 12:08:40.556079300 +0200
+++ admin/install.php 2010-05-05 16:30:28.251297600 +0200
@@ -670,6 +670,9 @@
<?php
}

  • temporarily disable the "friendly" error reporting, so that the progress can be monitored

  • $current_error_reporting_setting = error_reporting();
  • error_reporting(0);

    install the tables

    if( false == $g_failed ) {
            $g_db_connected = false;

    @@ -743,10 +746,14 @@
    }
    }
    if( $f_log_queries ) {

  • if( $t_sql ) {
    foreach( $sqlarray as $sql ) {
    echo htmlentities( $sql ) . ";\r\n\r\n";
    }
    } else {
  • echo "-- NOTE: The PHP function 'install_$sqlarray[0]' would have been run here.\r\n\r\n";
  • }
  • } else {
    echo 'Schema ' . $upgrade[$i][0] . ' ( ' . $t_target . ' )</td>';
    if( $t_sql ) {
    $ret = $dict->ExecuteSQLArray( $sqlarray );
    @@ -778,6 +785,8 @@
    } else {
    $t_install_state--;
    }
  • restore error reporting

  • error_reporting($current_error_reporting_setting);

    ?>

    </table>

dhx

dhx

2010-08-12 10:18

reporter   ~0026299

Thanks Otto for the patch and everyone else for reporting and debugging this issue.

It should be fixed now, ready for the next release.

@ottog: I haven't applied your error disabling patch yet as I have to look into that matter further. I think I'll end up rewriting the installer entirely as it is a big mess at the moment.

Related Changesets

MantisBT: master 0caa7aaa

2010-08-12 10:10

dhx


Details Diff
Fix 0011364: htmlentities invalid parameter type on pretend install

When pretending to install/upgrade MantisBT by writing SQL queries to
output rather than executing them, the following error would be
encountered:

SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array
given

Now we don't attempt to log upgrade function calls in amongst the dumped
query strings.

Thanks to Otto Giesenfeld for this patch (modified).
Affected Issues
0011364
mod - admin/install.php Diff File

MantisBT: master-1.2.x a553540e

2010-08-12 10:10

dhx


Details Diff
Fix 0011364: htmlentities invalid parameter type on pretend install

When pretending to install/upgrade MantisBT by writing SQL queries to
output rather than executing them, the following error would be
encountered:

SYSTEM WARNING: htmlentities() expects parameter 1 to be string, array
given

Now we don't attempt to log upgrade function calls in amongst the dumped
query strings.

Thanks to Otto Giesenfeld for this patch (modified).
Affected Issues
0011364
mod - admin/install.php Diff File