Forums  ›  General  ›  General discussions
 

Error Installing Forum

 

When the module install fails, we get a message output to the browser in the admin.  It isn't as simple as running the uninstall script after that message is sent to the browser?

It might be that simple. I will need to investigate. Some of the uninstall would not need to be run if the install did not complete. I just what to make sure there is no harm in running the entire uninstall script.

When the module install fails, we get a message output to the browser in the admin.  It isn't as simple as running the uninstall script after that message is sent to the browser?

 

Yes, all of the forum actions look like this.

forum edit all
forum delete all
forum make sticky

Ect, ect.

Just like all other modules like the ads.

ads view
ads browse
ads edit any ad

Ect.

I have looked at failed installs cleaning up. Won't be very simple. To do it, each sql statement that is run will need to be run one at at time and logged. Each one will need to also have a sql statement that can execute a undo if needed.

It can be done, but will complicate things for developers as they will not be able to just throw all the sql into one file as i will need them all in a structured format like a json file so each can be looped through one at a time in between logging the results of each. And they will need to have the needed undo sql to go with it.

 

Yes, all of the forum actions look like this.

forum edit all
forum delete all
forum make sticky

Ect, ect.

Just like all other modules like the ads.

ads view
ads browse
ads edit any ad

Ect.

I have looked at failed installs cleaning up. Won't be very simple. To do it, each sql statement that is run will need to be run one at at time and logged. Each one will need to also have a sql statement that can execute a undo if needed.

It can be done, but will complicate things for developers as they will not be able to just throw all the sql into one file as i will need them all in a structured format like a json file so each can be looped through one at a time in between logging the results of each. And they will need to have the needed undo sql to go with it.

I discussed over at Boonex years ago that if a module installation failed, that it should clean up after the failure.

It is possible that the old Dolphin site that someone did install the Forum but then decided it wasn't going to be used.  Looking at the install script, the actions are just forum without any prefix.

You could, but the forums might not work correctly. Appears some of the actions for the forums already exist.

I would try this first which should remove those actions.

DELETE `sys_acl_actions`, `sys_acl_matrix` FROM `sys_acl_actions`, `sys_acl_matrix` WHERE `sys_acl_matrix`.`IDAction` = `sys_acl_actions`.`ID` AND `sys_acl_actions`.`Name` IN('forum public read', 'forum public post', 'forum private read', 'forum private post', 'forum search', 'forum edit all', 'forum delete all', 'forum make sticky', 'forum del topics', 'forum move topics', 'forum hide topics', 'forum unhide topics', 'forum hide posts', 'forum unhide posts', 'forum files download');
DELETE FROM `sys_acl_actions` WHERE `Name` IN('forum public read', 'forum public post', 'forum private read', 'forum private post', 'forum search', 'forum edit all', 'forum delete all', 'forum make sticky', 'forum del topics', 'forum move topics', 'forum hide topics', 'forum unhide topics', 'forum hide posts', 'forum unhide posts', 'forum files download');


Unfortunately one of the drawbacks to a failure part way through a SQL script run, is some of the install of the forum already completed. So when you go to install it again it may fail somwhere else.

You could try also manually running the forums uninstall.sql from phpmyadmin.

I migrated a Dolphin site to Cheetah.  The Dolphin site was NOT using the forum; they were using vBulletin which is old and throws security errors.  Therefore, the managers of the site decided to just use the built-in Cheetah forum.  When I went to install the forum I got the following error message.  What is the best way to handle this?  I thought about just changing the INSERT to INSERT IGNORE and then try to install the forum again.

Installation of: Forum Failed

 

 

-- Changing database:
-- -- There are errors in the following MySQL queries:
-- -- Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2-93' for key 'PRIMARY'
INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES(@iLevelStandard, @iAction), (@iLevelPromotion, @iAction);
-- -- Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-94' for key 'PRIMARY'
INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES(@iLevelPromotion, @iAction);
-- -- Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '3-95' for key 'PRIMARY'
INSERT INTO `sys_acl_matrix` (`IDLevel`, `IDAction`) VALUES(@iLevelPromotion, @iAction);