PDA

View Full Version : upgrade_latest.php


dweeble
14-06-04, 12:50 PM
Hi
After downloading the latest from CVS, there's a upgrade_latest.sql and upgrade_latest.php. Is it correct to run the upgrade_latest.php after adding the upgrade_latest.sql to the database ?
The upgrade_latest.sql gave me and error on line 42 ?
Thanks
Mike

miinx
16-06-04, 04:19 PM
I'm just doing the same thing now..

Line 42 contains a very long string... I think that causes the error. (haven't tried it yet but have similar problems with other long string inserts before) If you can enter it manually via phpMyAdmin, do that.

I think there's another error tho -- Line 27:

UPDATE modules
SET permissions_item_table='users', permissions_item_field='user_id', permissions_item_label='user_username'
WHERE mod_directory='users';


In my database, there is no record in modules with mod_directory='users' and I wonder if this was meant to be "mod_directory='admin'", which is my User Admin module?

or am I missing a module? or an upgrade?

Thanks for any help,
Karen

miinx
16-06-04, 05:03 PM
Sorry, I lie...

Line 42 causes an error for me as there's already a record 2 in the table 'syskeys' which was inserted by the HelpDesk module. The main CVS doesn't contain the HelpDesk module, so it's clashing.

I'm new here so not sure on the procedure, but the CVS should probably be changed to remove the hard-coding of syskey_id?

To fix the file though...

Change line 42 where it says:
INSERT INTO `syskeys` VALUES (2, 'CustomField', ...
to
INSERT INTO `syskeys` VALUES (null, 'CustomField', ...

and line 43 where it says:
INSERT INTO `syskeys` VALUES("3", "ColorSelection", ...
to
INSERT INTO `syskeys` VALUES(null, "ColorSelection", ...

then you can run those lines fine.

Also, can confirm my suspicion above about line 27 -- have checked against a clean install of the latest CVS, and the equivalent line in the full dotproject.sql file is line 437:
INSERT INTO `modules` VALUES("9", "User Administration", "admin", "1.0.0", "", "core", "1", "User Admin", "helix-setup-users.png", "9", "1", "", "users", "user_id", "user_username");

which shows that mod_directory = 'admin' not 'users'.

So Line 27 of upgrade_latest.sql should actually read:
UPDATE modules
SET permissions_item_table='users', permissions_item_field='user_id', permissions_item_label='user_username'
WHERE mod_directory='admin';

and again the file /db/upgrade_latest.sql in the CVS probably needs to be updated?

Cheers,
Karen

dweeble
17-06-04, 12:45 PM
Karen
Thanks so much, worked great !!
Miked