using MAMP, PHP 5.2.3, MySQL 5.0.41

while installing drupal head, if I don't enter a database password, I get

PHP Notice:  Undefined index:  pass in includes/install.mysqli.inc on line 32

patch successfully tested on with and without db password.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pasqualle’s picture

can't reproduce this on XAMPP

Crell’s picture

Status: Needs review » Closed (duplicate)
blackdog’s picture

Status: Closed (duplicate) » Needs review
FileSize
1.5 KB

No, this is not a duplicate, and still not solved. I tried to install HEAD just now, with E_ALL errors on, and the installer breaks in two places, both becaues I don't have a MySQL password on my local machine.

Attached patch fixes both notices.

Pasqualle’s picture

I debugged, and can confirm that url[] does not have pass index defined when the database connection is without password
but I can't see the error message

so the question is: where is the message?
do you see it on page "Verify requirements", which page is skipped at install to me,
or do you use some special tool to track php notices,
or do you see it in some log file,
or is it displayed by MAMP?

scor’s picture

Pasqualle: MAMP doesn't display the errors in your browser by default. try to type tail /Applications/MAMP/logs/php_error.log in a terminal.

Pasqualle’s picture

ok, reproduced (I use XAMPP, so needed some tweaking, but learned something new)

Notice: Undefined index: pass in \install.php on line 158
Notice: Undefined index: pass in \includes\install.mysqli.inc on line 32

php.ini
error_reporting = E_ALL
log_errors = On
error_log = "E:\XAMPP\apache\logs\phperror.log"

restart apache

the key is the error_reporting = E_ALL, because drupal sets this variable after the notice

testing...

Pasqualle’s picture

Status: Needs review » Reviewed & tested by the community

the patch works

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Jax’s picture

Version: 6.x-dev » 6.0-rc2
Status: Closed (fixed) » Needs review
FileSize
1.24 KB

The patch isn't ok. If you check for an isset you should set the value to the empty string in stead of NULL. Because else the next isset will trigger again. Moreover, this should be fixed for the other db's as well.

So I include a patch that converts the NULL to "" and does the isset for the other db types as well.

Jax’s picture

Status: Needs review » Reviewed & tested by the community

Well, I've tested it myself and it works. So if you want to get rid of the notice on an empty password for mysql too, please commit.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed
FileSize
3.12 KB

Actually, the same code was already present in the runtime versions of these files, just it was a bit more verbose. Now unified to use the same syntax, committed the attached patch.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.