This is a patch to remove the E_ALL errors I got when testing an installation of Drupal 5. I only updated the MySQL code but it's a start.

Comments

ChrisKennedy’s picture

StatusFileSize
new6.45 KB

This version ports the db-related changes to pgsql and mysqli as well.

peterx’s picture

Form .inc about line 320 after previous patch:
else if ($user->uid && !$form['#programmed']) {
>>>
else if (isset($user->uid) and $user->uid && !$form['#programmed']) {

Conditionally create $edit about line 750, just before $args = array_merge(array($form), array($edit), $args);:
if(!isset($edit))
{
$edit = '';
}

peterx’s picture

Just a note. I am working with RC1. install_e_all.patch is needed for RC1.

peterx’s picture

Two other things I found that are worth noting somewhere on the install page.

You need "create temporary table" permission at the user level.

In the advanced database section, there is a note about using a prefix if you want to have multiple sites. That prefix is also needed if you are adding other applications to the site as other applications might use tables of the same name. I need the prefix so I tried emptying the database then rerunning install.php but just ended up with a jumble of error messages. There is no not on the install page about install.txt and install.txt does not say how to rerun the install.

peterx’s picture

I found that I could restart the install by recopying the defaule settings.php. Should be mentioned in install.txt. I then received the following message. The user has create temp table permission. I put the error here because the previous patches were for SQL.

Drupal installation complete

* user warning: Access denied for user: 'backup@localhost' to database 'backup' query: CREATE TEMPORARY TABLE missing_nids SELECT n.nid, n.created, n.uid FROM drupal_node n LEFT JOIN drupal_node_comment_statistics c ON n.nid = c.nid WHERE c.comment_count IS NULL in I:\home\vhosts\backup\web\includes\database.mysql.inc on line 167.
* user warning: Table 'backup.missing_nids' doesn't exist query: INSERT INTO drupal_node_comment_statistics (nid, last_comment_timestamp, last_comment_name, last_comment_uid, comment_count) SELECT n.nid, n.created, NULL, n.uid, 0 FROM missing_nids n in I:\home\vhosts\backup\web\includes\database.mysql.inc on line 167.

heine’s picture

@peterx, please open seperate issues (after checking the queue whether those are known issues). Please keep this issue to E_ALL compliance of the install phase.

peterx’s picture

The following message appeared when setting up the administrator user. It was reported 16 weeks ago in http://drupal.org/node/31821 for 4.6.9.

warning: mail() [function.mail]: SMTP server response: 451 See http://pobox.com/~djb/docs/smtplf.html. in I:\home\vhosts\backup\web\includes\common.inc on line 1949.

ChrisKennedy’s picture

StatusFileSize
new6.45 KB

Syncing with HEAD. It would be nice to get this in before release as it will help new users out and reduce support issues.

ChrisKennedy’s picture

StatusFileSize
new13.75 KB

I found some other places to fix E_ALL compliance during installation. I also factored out the urldecoding of the database url into db_decode_url() and put it in includes/database.inc.

ChrisKennedy’s picture

StatusFileSize
new17.73 KB

Re-rolled with a few more fixes.

ChrisKennedy’s picture

StatusFileSize
new17.24 KB

Oops, didn't mean to include the error reporting change.

Steven’s picture

Such a patch is rather useless without clear addition to the coding guidelines that set out when you need to create variables and when you don't. There has been some confusion over this in the past, and if we don't document it, it won't take long for errors to creep in again.

ChrisKennedy’s picture

No one has disagreed that E_ALL compliance should be added to the coding guidelines. More importantly, http://drupal.org/node/99625 needs to be committed.

dries’s picture

Looks good. Maybe it is better to get rid of the $db_url all together? Instead we could have $db_user, $db_name, $db_pass, etc.

ChrisKennedy’s picture

IMO keeping it as an array is easier when you are passing the data between functions or dealing with multiple db_urls - keep it organized into one variable. It also stabilizes the API by allowing new keys to be added without needing to change function definition. Either way is fine with me though.

ChrisKennedy’s picture

StatusFileSize
new18.29 KB
webchick’s picture

Status: Needs review » Needs work
StatusFileSize
new19.14 KB

This patch still leaves me with notices...

a) on the main install screen (assuming you have E_ALL set in your php.ini)

Notice: Trying to get property of non-object in /Applications/MAMP/htdocs/head/includes/form.inc on line 325 ... in fact, this one kills the install process altogether when I hit the "Save configuration" button, since it's outputting headers.

Notice: Undefined variable: edit in /Applications/MAMP/htdocs/head/includes/form.inc on line 760

This patch includes the fixes for those from http://drupal.org/node/93630 which I've marked as a dupe of this bug; even though it was created first (not sure how it was missed in a search??), this one is more complete.

This now seems to fix all notice issues during the install process, and several of them within the normal operation of core, too.

webchick’s picture

Status: Needs work » Needs review
webchick’s picture

Version: 5.x-dev » 6.x-dev

Also, moving to 6.x .. it involves an API change with the addition of the db_decode_url function.

dries’s picture

Status: Needs review » Needs work

The following statements look a bit awkward to me:

+  if (!isset($info->help)) {
+    $info->help = NULL;
+  }
+  if (!isset($info->min_word_count)) {
+    $info->min_word_count = NULL;
+  }

Would also be nice to get rid of db_decode_url. Plus, that looks like an internal function to me. Prefix with underscore?

ChrisKennedy’s picture

Status: Needs work » Closed (fixed)

Closing - these have been fixed in other issues.

juan_g’s picture