You get this if Views module is not installed...

Fatal error: Call to undefined function: views_invalidate_cache() in /location/location.install on line 121

wrapping that in an if (module_exists('views')) lets you proceed, but then you get:



    * user warning: Unknown column 'oid' in 'location' query: ALTER TABLE location CHANGE oid eid int unsigned NOT NULL default '0' in /includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry 'location_lid' for key 1 query: INSERT INTO sequences (name, id) VALUES ('location_lid', 292) in /includes/database.mysql.inc on line 172.
    * user warning: Unknown column 'oid' in 'location' query: ALTER TABLE location CHANGE oid eid int unsigned NOT NULL default '0' in /includes/database.mysql.inc on line 172.
    * user warning: Duplicate column name 'lid' query: ALTER TABLE location ADD COLUMN lid int(10) unsigned NOT NULL default '0' AFTER eid in /includes/database.mysql.inc on line 172.
    * user warning: Duplicate entry 'location_lid' for key 1 query: INSERT INTO sequences (name, id) VALUES ('location_lid', 292) in /includes/database.mysql.inc on line 172.
    * user warning: Duplicate column name 'is_primary' query: ALTER TABLE location ADD COLUMN is_primary tinyint NOT NULL default '0' in /includes/database.mysql.inc on line 172.

Comments

webchick’s picture

This was the schema of the old table before the update:


CREATE TABLE `location` (
  `oid` int(10) unsigned NOT NULL default '0',
  `type` varchar(6) NOT NULL default '',
  `name` varchar(255) default NULL,
  `street` varchar(255) default NULL,
  `additional` varchar(255) default NULL,
  `city` varchar(255) default NULL,
  `province` varchar(16) default NULL,
  `postal_code` varchar(16) default NULL,
  `country` char(2) default NULL,
  `latitude` decimal(10,6) default NULL,
  `longitude` decimal(10,6) default NULL,
  `source` tinyint(4) default '0',
  PRIMARY KEY  (`type`,`oid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

The update wanted to start at #3.

webchick’s picture

And here's the one now:

CREATE TABLE `location` (
  `eid` int(10) unsigned NOT NULL default '0',
  `lid` int(10) unsigned NOT NULL default '0',
  `type` varchar(6) NOT NULL default '',
  `name` varchar(255) default NULL,
  `street` varchar(255) default NULL,
  `additional` varchar(255) default NULL,
  `city` varchar(255) default NULL,
  `province` varchar(16) default NULL,
  `postal_code` varchar(16) default NULL,
  `country` char(2) default NULL,
  `latitude` decimal(10,6) default NULL,
  `longitude` decimal(10,6) default NULL,
  `source` tinyint(4) default '0',
  `is_primary` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`lid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
rainer7’s picture

if i change location table as described, i get a new error:

user warning: Duplicate entry '0' for key 1 query: INSERT INTO location (eid, type, latitude, longitude, source) VALUES (2, 'user', '48.994731', '8.382301', '1') in....

thanks for any help

Nick Brown’s picture

Title: update.php pukes and dies » need to check that views module is present during install
Status: Active » Needs review
StatusFileSize
new447 bytes

Adding a patch

Nick Brown’s picture

Priority: Normal » Critical
dww’s picture

Status: Needs review » Reviewed & tested by the community

Still a critical bug (just ran into it on an old site I'm updating). Miraculously, the patch in #4 still applies. Obviously, it still fixes the bug. Now that this module is under new management, hopefully we'll see a commit at long last. ;)

dww’s picture

StatusFileSize
new763 bytes

Oh, and here's a version for the DRUPAL-4-7 branch, for folks (like me) that are trying to finally get a site off 4.6.x. ;)

brmassa’s picture

Status: Reviewed & tested by the community » Fixed

Derek,

fixed on HEAD.

massa

PS: Just remember: HEAD is now the pre-Location 3 for Drupal 5 (soon we will move it to DRUPAL-5--3 branch). so you should not use it for 4.7 sites...

dww’s picture

Version: 6.x-3.x-dev » 4.7.x-1.x-dev
Status: Fixed » Patch (to be ported)

Yes, I understand that HEAD is for the latest code. ;) I'm saying, this is a bug in an old update, that you'd hit when upgrading from 4.6.x to 4.7.x if you actually followed the core upgrade instructions. therefore, you need to fix this in the older branches, too. that's why i supplied the patch in #7.

bdragon’s picture

Assigned: Unassigned » bdragon

I'm handling the 4.7 backports for install file functions..

bdragon’s picture

Status: Patch (to be ported) » Fixed

Committed to DRUPAL-4-7.

dww’s picture

yay.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.