Bug in 3.0.5beta install.php

2007-03-20
2013-05-02
  • Nobody/Anonymous

    I downloaded the new 3.0.5beta (SVN 422) and tried to install on my XP laptop running XAMPP. When I loaded install.php, I got the following error:

    <code>
    Failed to do query: Unknown column 'lastLogin' in 'field list'
    In query: INSERT INTO users (reg_email,confirm_hash,password,usertype,lastLogin) VALUES ('admin@example.com', '5594d53f03efd49768cb2245528cc9a3', MD5('admin'), 'register',NOW())
    </code>

    I examined the code in install.php, and found that the code to create the USER db table (lines 155-171 of install.php) does not create a 'lastLogin' field, which is queried every time a member of the 'user' class is called (see line 101 of User.class.php). I haven't tinkered to figure out if adding a line to install.php (creating a 'lastLogin' field in the User table) is enough to fix the problem, but TAB3 won't install as is...

     
    • Nobody/Anonymous

      It gets weirder. I added a line to install.php to create a 'lastLogin' DATETIME field, and the installation worked - except that it immediately told me to upgrade, and upgrading doesn't work. I tried the default upgrade.php link, but that didn't work (error: version is 3.0.3). I restarted from scratch, and tried loading upgrade.php?redo=_3.0.4, but that also didn't work (now error: version is 3). Has anyone been able to get the SVN version working as a fresh install?

       
    • katzlbt

      katzlbt - 2007-03-22

      It is correct for install.php not to create lastLogin.
      Install creates DB 3.0 then all upgrade scripts should be executed one after the other automatically.

      I have reproduced the bug on install and will fix it soon.

       
    • katzlbt

      katzlbt - 2007-03-22

      FIX: The tail of install.php needs to be replaced by this code then the install will work:

      require_once('lib/backEnd/User.class.php');
      require_once('lib/backEnd/GuestUser.class.php');

      $db->query("INSERT INTO {$db_prefix}users (reg_email,confirm_hash,password,usertype) VALUES ('admin@example.com', NULL, MD5('admin'), 'admin')");

      require_once('lib/frontEnd/pages/PageInstall.class.php');

      $page = new PageInstall($warnings);
      echo $page->create();

      exit();

       
    • Nobody/Anonymous

      Thanks for the update! I got the fresh install working (for some reason, I couldn't upgrade from 1.04e to 2.1, so it seems I have to re-enter my data). Now I have a minor bug to report:

      I live in Massachusetts, USA, where postal codes begin with zeros. I see in the database that the 'zip' field is a varchar(20) (good), but it seems that some function somewhere is converting it to a number or otherwise stripping off leading zeros. As a result, my zipcode displays as 2138 instead of 02138. US zip codes should be displayed as either 5 or 10 characters - leading zeros should be displayed. I don't really understand the code structure, though, so I haven't been able to figure out where the problem is.

      Thanks again for the 3.0.5 update.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks