vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Remove Products Manually (https://vborg.vbsupport.ru/showthread.php?t=287449)

Black Snow 09-04-2012 02:04 PM

Remove Products Manually
 
Is there a way to remove products manually? I used to run 4.1.3 suite but now I run 4.2.0 forum and I keep getting an error when uninstalling products.

The error is always linked to the cms table. I hope it is possible.

kh99 09-04-2012 02:30 PM

What error are you getting? I think there was an error involving a CMS table in the original vb4.2.0 that should be fixed in the latest PL2 version).

Black Snow 09-04-2012 02:44 PM

Quote:

Originally Posted by kh99 (Post 2362590)
What error are you getting? I think there was an error involving a CMS table in the original vb4.2.0 that should be fixed in the latest PL2 version).

This is the one I get when trying to remove the CMS that was installed.
Quote:

Database error in vBulletin 4.2.0:

Invalid SQL:

DELETE cms_widgettype, cms_widget, cms_widgetconfig
FROM xxx_package AS package
LEFT JOIN xxx_cms_widgettype AS cms_widgettype
ON cms_widgettype.packageid = package.packageid
LEFT JOIN xxx_cms_widget AS cms_widget
ON cms_widget.widgettypeid = cms_widgettype.widgettypeid
LEFT JOIN xxx_cms_widgetconfig AS cms_widgetconfig
ON cms_widgetconfig.widgetid = cms_widget.widgetid
WHERE package.productid = 'vbcms';

MySQL Error : Table 'xxx.xxx_cms_widgettype' doesn't exist
Error Number : 1146
Request Date : Tuesday, September 4th 2012 @ 10:33:39 AM
Error Date : Tuesday, September 4th 2012 @ 10:33:39 AM
Script : http://xxx/forum/admincp/plugin.php?do=productkill
Referrer : http://xxx/forum/admincp/plugin.php?...uctid=vbcms&s=
IP Address :
Username :
Classname : vB_Database
MySQL Version : 5.5.23-55

kh99 09-04-2012 02:55 PM

Hmm...so do you not have the CMS installed at all?

What you might be able to do is put your site in debug mode (edit the includes/config.php and add $config['Misc']['debug'] = 1; somewhere after the first line). You might want to close the forum first. Then go to the product manager and you should have a choice on the right to edit the product. That should let you edit the uninstall code, and you can comment out the query that's causing the error. Then try again to uninstall the product. (and when you're done, remember to turn off debug mode).

Black Snow 09-04-2012 03:02 PM

I'll back my forum up first.

kh99 09-04-2012 03:06 PM

That's never a bad idea. But this is actually safer than trying to manually remove a product, which would involve changing the database directly. In this case the most you could do is cause another error in the uninstall code and you wouldn't really be any worse off than you are.

Black Snow 09-04-2012 03:14 PM

This is the code for the uninstall:
Code:

/*
the CMS add a lot of things to the cache.  When we do an uninstall we need to clear those values, otherwise things get weird when we do the reinstall.  It would be better to be a bit smarter about what we clear, but uninstalling CMS is a rare enough event that clearing the whole thing isn't going to be a significant burden on the system.
*/
$db->query_write("DELETE FROM " . TABLE_PREFIX . "cache");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_article");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_grid");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_layout");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_category");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_nodecategory");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_layoutwidget");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_node");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_nodeconfig");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_nodeinfo");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_widget");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_widgetconfig");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_permissions");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_sectionorder");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_widgettype");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_statichtml");
$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_navigation");


// Drop fields
require_once(DIR . '/includes/class_dbalter.php');
$db_alter = new vB_Database_Alter_MySQL($db);

if ($db_alter->fetch_table_info('usergroup'))
{
        $db_alter->drop_field('vbcmspermissions');
}

if ($db_alter->fetch_table_info('administrator'))
{
        $db_alter->drop_field('vbcmspermissions');
}


// Packages, routes, actions, contenttypes
$db->query_write("
        DELETE package, route, action, contenttype
        FROM " . TABLE_PREFIX . "package AS package
        LEFT JOIN " . TABLE_PREFIX . "route AS route
                ON route.packageid = package.packageid
        LEFT JOIN " . TABLE_PREFIX . "action AS action
                ON action.routeid = route.routeid
        LEFT JOIN " . TABLE_PREFIX . "contenttype AS contenttype
                ON contenttype.packageid = package.packageid
        WHERE productid = 'vbcms'
");

// Grid templates
$db->query_write("
DELETE FROM " . TABLE_PREFIX . "template
WHERE title LIKE 'vbcms_grid_%'
        AND templatetype = 'template'
        AND styleid = 0
        AND product = 'vbcms'
");

// Clear cms cache objects
require_once(DIR . '/includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();

vB_Cache::instance()->event('vb_types.contenttype_updated');
vB_Cache::instance()->event('vb_types.package_updated');
vB_Cache::instance()->event('vb_types.type_updated');
vB_Cache::instance()->event('vb_cmstypes.widgettype_updated');

vB_Shutdown::instance()->shutdown();

$db->query_write("
        DELETE FROM " . TABLE_PREFIX . "cron
        WHERE varname = 'vbcms_daily_cleanup'
        AND product = 'vbcms'
");

$db->query_write("DROP TABLE IF EXISTS " . TABLE_PREFIX . "cms_rate");

I'm not sure what to comment out.

kh99 09-04-2012 03:16 PM

I don't see that query in there. That looks like it's from the CMS itself, is that what you're trying to uninstall?

Black Snow 09-04-2012 03:18 PM

Yes. I'm trying to uninstall the CMS. It shows in the product manager.

There are other mods I want to uninstall too but they all give a similar error that involves the CMS table(s).

kh99 09-04-2012 03:32 PM

You should be able to uninstall it, as far as I know. I guess it does some automatic uninstalling of components before it runs the product uninstall code, so my idea won't work.

Another thing you could do is to try to create the missing tables. From the error you can see you're missing the xxx_cms_widgettype table, and it has a packageid, widgettypeid, and widgetid fields (which are probably all INT). You could try creating that through phpmyadmin (asusming you have that available), then try again.


All times are GMT. The time now is 08:50 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01171 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete