Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Prev Previous Post   Next Post Next
  #1  
Old 03-22-2015, 04:31 PM
Guest210212002
Guest
 
Posts: n/a
Default DB Error uninstalling Plugin

I'm cleaning up my vb3 install before migrating up to vb4, and one of the plugins I'm uninstalling is teh viglink plugin. Here's the uninstall code:

Code:
 <uninstallcode><![CDATA[if( ! defined( "VGLNK_IN_UPDATER" ) || defined( "VGLNK_IN_INSTALLER" ) ) {
  define( "VGLNK_VERSION", "2.0.7" );
}

define( "VGLNK_BASE_DIR", defined( "DIR" ) ? DIR : ( dirname( __FILE__ ) . "/../.." ) );
define( "VGLNK_CRON_DIR", VGLNK_BASE_DIR . "/includes/cron" );
define( "VGLNK_UPDATE_LOADER", VGLNK_CRON_DIR . "/viglink_updater.php" );

define( "VGLNK_BASE_URL", "http://cdn.viglink.com/downloads/vbulletin" );
define( "VGLNK_UPDATE_URL", VGLNK_BASE_URL );
define( "VGLNK_VERSION_URL", VGLNK_BASE_URL . "/version.xml" );

$vl_link_insertion_fields_r = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "viglink_link_insertion ORDER BY id DESC;");
$vl_link_insertion_fields = $vbulletin->db->fetch_array($vl_link_insertion_fields_r);
$vl_ID_own = $vl_link_insertion_fields['link_insertion_ownposts'];
$vl_ID_posts = $vl_link_insertion_fields['link_insertion_inposts'];

if($vl_ID_own && $vl_ID_posts) {
  $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid = ".$vl_ID_own." OR profilefieldid = ".$vl_ID_posts.";");
  $vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP COLUMN field".$vl_ID_posts.";");
  $vbulletin->db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP COLUMN field".$vl_ID_own.";");
}

$vbulletin->db->query_write("DROP TABLE IF EXISTS `" . TABLE_PREFIX . "viglink_link_insertion");

]]></uninstallcode>
I get the following error when I go to uninstall the product from the ACP:

Quote:
Database error in vBulletin 3.8.8:

Invalid SQL:
ALTER TABLE userfield DROP COLUMN field29;;

MySQL Error : Can't DROP 'field29'; check that column/key exists
I get the error uninstalling it on my 3.8.8 forum, and my vb4 test platform as well. If I go to my user profile field manager, I see profile fields that go up to field25. My thought was that I'd just add field29 myself so it's there and "droppable", but when I add new a new field it shows up as field31.

What's my best bet here? Create field29 (somehow?) so that it can be dropped? Or is there a way that I can execute just that uninstall code and remove the field it's failing on?

I tried a reinstall of the Product itself with allow overwrite enabled, but even with the fresh install I still get this DB error when I try to remove it.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09577 seconds
  • Memory Usage 2,213KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete