New Install bugs

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

New Install bugs

Postby ITI » Wed Dec 28, 2011 8:05 pm

I've been evaluating PHP Blogging software options and so far I'm quite impressed with PivotX.
However, there are a few installation bugs that I had to resolve to get it installed.
Version: 2.3.1

1. To resolve the initial php fatal error you need to correct "pivotx/render.php".
When the program is not yet installed, you must exit() after the redirection to prevent the rest of the script from executing eliminating the fatal error.
Open "render.php" in a text editor such as note pad ("render.php" is found in the pivotx subdirectory):
Add exit(); to line 77 and don't forget the semi-colon.
Code: Select all
if (!isInstalled()) {
    if (strpos($_SERVER['PHP_SELF'], "pivotx/render.php")>0) {
        $location = "index.php";
    } else {
        $location = "pivotx/index.php";
    }
    header("Location: ".$location);
    exit(0);   // <<<<<<<<<<<<< you must add this line of code to prevent the rest of the page from executing.
}
You should always exit() after a header redirection call.

2. The default data is not loaded during the install nor can you create a "New Entry"
This is caused by the field "extrafields" in tables "pivotx_entries" and "pivotx_pages" requiring a value that is not being supplied.
To correct this you must remove the "NOT NULL" from "extrafields" in function makePagesTable($sql) on line 783.
Change the line `extrafields` text collate utf8_unicode_ci NOT NULL, to `extrafields` text collate utf8_unicode_ci,
Code: Select all
function makePagesTable($sql) {
    global $PIVOTX;

    $tablename = safeString($PIVOTX['config']->get('db_prefix')."pages", true);

    $userdata = $PIVOTX['users']->getUsers();
    $username = $userdata[0]['username'];

    $query1 = "CREATE TABLE `$tablename` (
      `uid` int(11) NOT NULL auto_increment,
      `title` tinytext collate utf8_unicode_ci NOT NULL,
      `uri` tinytext collate utf8_unicode_ci NOT NULL,
      `subtitle` tinytext collate utf8_unicode_ci NOT NULL,
      `introduction` mediumtext collate utf8_unicode_ci NOT NULL,
      `body` mediumtext collate utf8_unicode_ci NOT NULL,
      `convert_lb` int(11) NOT NULL default '0',
      `template` tinytext collate utf8_unicode_ci NOT NULL,
      `status` tinytext collate utf8_unicode_ci NOT NULL,
      `date` datetime NOT NULL default '0000-00-00 00:00:00',
      `publish_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `edit_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `chapter` int(11) NOT NULL default '0',
      `sortorder` int(11) NOT NULL default '0',
      `user` tinytext collate utf8_unicode_ci NOT NULL,
      `allow_comments` int(11) NOT NULL default '0',
      `keywords` tinytext collate utf8_unicode_ci NOT NULL,
      `extrafields` text collate utf8_unicode_ci,
      PRIMARY KEY  (`uid`),
      FULLTEXT KEY `title` (`title`,`subtitle`,`introduction`,`body`, `keywords`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    ";


And the same in function makeEntriesTable($sql) on line 906.
Code: Select all
function makeEntriesTable($sql) {
    global $PIVOTX;

    $tablename = safeString($PIVOTX['config']->get('db_prefix')."entries", true);

    $userdata = $PIVOTX['users']->getUsers();
    $username = $userdata[0]['username'];

    $query1 = "CREATE TABLE `$tablename` (
      `uid` int(11) NOT NULL auto_increment,
      `title` tinytext collate utf8_unicode_ci NOT NULL,
      `uri` tinytext collate utf8_unicode_ci NOT NULL,
      `subtitle` tinytext collate utf8_unicode_ci NOT NULL,
      `introduction` mediumtext collate utf8_unicode_ci NOT NULL,
      `body` mediumtext collate utf8_unicode_ci NOT NULL,
      `convert_lb` int(11) NOT NULL default '0',
      `status` tinytext collate utf8_unicode_ci NOT NULL,
      `date` datetime NOT NULL default '0000-00-00 00:00:00',
      `publish_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `edit_date` datetime NOT NULL default '0000-00-00 00:00:00',
      `user` tinytext collate utf8_unicode_ci NOT NULL,
      `allow_comments` int(11) NOT NULL default '0',
      `keywords` tinytext collate utf8_unicode_ci NOT NULL,
      `via_link` tinytext collate utf8_unicode_ci NOT NULL,
      `via_title` tinytext collate utf8_unicode_ci NOT NULL,
      `comment_count` int(11) collate utf8_unicode_ci NOT NULL,
      `comment_names` mediumtext collate utf8_unicode_ci NOT NULL,
      `trackback_count` int(11) collate utf8_unicode_ci NOT NULL,
      `trackback_names` mediumtext collate utf8_unicode_ci NOT NULL,
      `extrafields` text collate utf8_unicode_ci,
      PRIMARY KEY  (`uid`),
      FULLTEXT KEY `title` (`title`,`subtitle`,`introduction`,`body`, `keywords`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";


Because PivotX caches it's pages just making these correction after you have tried to do an install will not fix the tables.
Start from scratch:
1. Make the changes to the source files on your local computer.
2. Delete all the files on your remote server in pivotx directory.
3. Upload the new modified files.
4. Access your database and "drop" all the tables (if you don't do this the tables will still exist, require a value and won't populate with the default data)

You should end up with a clean error free installation.
I'm sure the dev team will want to look into this further and this should be a good starting point to correct future issues and versions.

Hope this helps new users.
Glen
ITI Internetworking Technologies Inc.
ITI
 
Posts: 7
Joined: Wed Dec 28, 2011 7:01 pm
Location: Edmonton, Alberta, Canada

Re: New Install bugs

Postby hansfn » Sat Dec 31, 2011 8:55 am

Hi. I have fixed the missing exit/die call after the redirect in revision 4030. (I reviewed all the redirects in our codebase and found one more missing exit/die call.)

I'm not able to reproduce the problem with the field "extrafields" in tables "pivotx_entries" and "pivotx_pages". Probably my MySQL version is too old and less strict than your. Anyway, the correct fix is to remove the field "extrafields" since we are now using a separate table for the extra fields. I'll fix this shortly.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron