Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-10097

phpBB3 assumes that for a MySql database the auto_increment is set to 1. As with many load balanced MySql server setups this is not true for us. Having an auto_increment of 2 means that all the foreign keys (and other data) is wrong.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 3.0.8
    • None
    • Version:3.0.8
      Mysql:MySQL(i) 5.1.44
      OS:Linux

      I am installing phpBB3 on a linux server - all goes fine with the install until the final stage. Then I get a 'General Error:Could not get style data' error message.

      This comes from ./includes/session.php at line 1634. The sql it generates is:

      SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name FROM phpbb_styles s, phpbb_styles_template t, phpbb_styles_theme c, phpbb_styles_imageset i WHERE s.style_id = 1 AND t.template_id = s.template_id AND c.theme_id = s.theme_id AND i.imageset_id = s.imageset_id;

      The result is:

      Empty set (0.01 sec)

      OK, after a lot of digging I have found out why I get this 'Could not get style data' error message. In the file /includes/session.php there is this line (line 1605):

      $style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);

      which returns 1 after install as there is only 1 style ('prosilver') installed. However later there is the line 1608
      which has the sql condition:

      WHERE s.style_id = $style which would make perfect sense if the auto_increment on the MySql database was set to 1 as the first style_id in table phpbb_styles would be '1'. But in an environment with Server Load Balancing for the MySql server auto_increment can be set to 2 (which it is in our case).

      I can of course add '&style=2' to the URL, but this is only a short term fix - the PHP code needs fixing.

            Unassigned Unassigned
            adrianbirch adrianbirch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: