[3.0.8 Update] Fatal error: in */db/dbal.php on line 676

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29252
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

[3.0.8 Update] Fatal error: in */db/dbal.php on line 676

Post by Marshalrusty » Sat Nov 20, 2010 9:06 pm

Introduction
  • Since the release of 3.0.8, it has come to our attention that database schema changes made by several popular MODs break compatibility with the user_add() function. While default values are standard on all compatible default columns, some data types (such as 'TEXT') cannot have default values and some MODs incorrectly omit default values altogether.

    An entry must be added to the user_add() function for any column in the users database table that does not have a default value. Without this entry, queries built by the function lack a set value for the column, which results in a database error.

    If you ran the 3.0.8 update and received the following error, follow the rest of this guide. For all other issues, please start a new topic in this forum.

    Code: Select all

    Updating database to latest stable release
    
    Updating database schema
    
    Progress :: No updates required
    
    Updating data
    
    Progress :: . . . . . . . . . .
    Fatal error: in */includes/db/dbal.php on line 676
Modify the DBAL to display errors
  1. Run the update You should receive the error message above.
  2. Open includes/db/dbal.php
  3. Find the following:

    Code: Select all

    				global $msg_long_text;
    				$msg_long_text = $message;
  4. Directly after (on the next line), add:

    Code: Select all

    				die($msg_long_text);
  5. Final result should be:

    Code: Select all

    				global $msg_long_text;
    				$msg_long_text = $message;
    				die($msg_long_text);
Add the necessary entries to user_add()
  1. Attempt to run the update again.You should get an error message that looks like the following:

    Code: Select all

    Field 'user_note' doesn't have a default value [1364]
    SQL
    <snip>
    user_note is the name of the column that's causing the problem (yours will probably be different). Write down the name of the column somewhere. At the end of this exercise, you should figure out which MODs these columns belong to and notify the MOD authors.
  2. Open includes/functions_user.php
  3. Find the following:

    Code: Select all

    function user_add($user_row, $cp_data = false)
  4. Within that function, find:

    Code: Select all

    		'user_form_salt'			=> unique_id(),
  5. Now it's time to add the new line for that column from step 1:

    Code: Select all

    		'user_form_salt'			=> unique_id(),
    		'user_note'					=> '',
    Note the new line above. Just replace user_note with whatever the column name was in step 1.
  6. Try running the update again. If you get the error message about a different column, go back to step 1 and do this again for the new column. The number of times you have to do this depends on the number of columns incorrectly added by MODs.
  7. Remove the debug code (die($msg_long_text);) that you added to includes/db/dbal.php.
Wrap Up
  • If you have trouble with the directions above, please start a new topic in this forum and we will help you. You should, however, try the above before starting a topic. You may need to read through the instructions a few times.

    If you find a mistake anywhere in this guide or can think of a way to improve it, please PM me or any Support Team Member.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29252
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: [3.0.8 Update] Fatal error: in */db/dbal.php on line 676

Post by Marshalrusty » Sun Nov 21, 2010 1:16 am

Bumping this as the first post has been edited to include a guide.

I would like to emphasize that (certain) MOD code is the problem here, not the default software. Our QA process missed this because we did not anticipate that user_add() would be rendered unusable directly (which should never happen). You should notify the authors of any MOD that causes this problem.
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

Locked

Return to “[3.0.x] Support Forum”