Zen Cart Logo
Forums / General Questions / uninstall SQL patch that's messed up my site

uninstall SQL patch that's messed up my site

Locked

Views: 3,959

Results 1 to 20 of 30
This thread is locked. New replies are disabled.
5 Feb 2009, 10:30 PM
#1
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

uninstall SQL patch that's messed up my site

I have just installed a MOD that's completely messed up my site layout.

How on earth do I uninstall these 2 SQL patches? Please, I need very basic instructions as I have no clue where to start:

QT Pro V4.0 Date: 11/27/2004

Insert configuration group for Product Information page

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) VALUES (888001, 'Dynamic Drop Downs', 'Dynamic Drop Downs configuration options', 8, 1);

Insert configuration keys for Product Information Page

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Product Info Single Attribute Display Plugin', 'PRODINFO_ATTRIBUTE_PLUGIN_SINGLE', 'multiple_dropdowns', 'The plugin used for displaying attributes on the product information page.', 888001, 1, now(), NULL, 'zen_cfg_select_option(array('single_radioset', 'single_dropdown','multiple_dropdowns','sequenced_dropdowns'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Product Info Multiple Attribute Display Plugin', 'PRODINFO_ATTRIBUTE_PLUGIN_MULTI', 'sequenced_dropdowns', 'The plugin used for displaying attributes on the product information page.', 888001, 1, now(), NULL, 'zen_cfg_select_option(array('single_radioset', 'single_dropdown','multiple_dropdowns','sequenced_dropdowns'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Show Out of Stock Attributes', 'PRODINFO_ATTRIBUTE_SHOW_OUT_OF_STOCK', 'True', 'Controls the display of out of stock attributes.', 888001, 10, now(), NULL, 'zen_cfg_select_option(array('True', 'False'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Mark Out of Stock Attributes', 'PRODINFO_ATTRIBUTE_MARK_OUT_OF_STOCK', 'Right', 'Controls how out of stock attributes are marked as out of stock.', 888001, 20, now(), NULL, 'zen_cfg_select_option(array('None', 'Right', 'Left'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Display Out of Stock Message Line', 'PRODINFO_ATTRIBUTE_OUT_OF_STOCK_MSGLINE', 'True', 'Controls the display of a message line indicating an out of stock attributes is selected.', 888001, 30, now(), NULL, 'zen_cfg_select_option(array('True', 'False'),');
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES ('Prevent Adding Out of Stock to Cart', 'PRODINFO_ATTRIBUTE_NO_ADD_OUT_OF_STOCK', 'True', 'Prevents adding an out of stock attribute combination to the cart.', 888001, 40, now(), NULL, 'zen_cfg_select_option(array('True', 'False'),');

Add new column to products_options to indicate if stock should be tracked

for an option

ALTER TABLE products_options
ADD products_options_track_stock tinyint(4) default '1' not null
AFTER products_options_name;

Please, someone help.

5 Feb 2009, 10:42 PM
#2
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

It doesn't have any options to disable it from the admin, it has 4 settings, none of which are off. Totally screwed up the layout, pushed the tabs to the bottom, added an extra large image and deleted the additional images... What a mess :cry::cry:

5 Feb 2009, 10:43 PM
#3
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

is there some way to write an uninstall patch for this?

5 Feb 2009, 11:03 PM
#4
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

I think I'm going to need a clean install here.... can anyone help?

I'm thinking about completely deleting the ADMIN folder and re-uploading the install ADMIN folder then having to go through and install all the working SQL patches and redo all the settings...

Surely there's something less drastic I can do here?

5 Feb 2009, 11:10 PM
#5
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

run this from your Admin > Install SQL Patches

DELETE FROM configuration_group WHERE configuration_group_title = 'Dynamic Drop Downs';
DELETE FROM configuration WHERE 'configuration_group_id' = 888001;
ALTER TABLE products_options DROP products_options_track_stock;
5 Feb 2009, 11:14 PM
#6
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Did that,

Now I'm getting this mesasge on product pages:

1054 Unknown column 'popt.products_options_track_stock' in 'field list'
in:
[select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock from products_options popt, products_attributes patrib where patrib.products_id='2' and patrib.options_id = popt.products_options_id and popt.language_id =1 and popt.products_options_track_stock = '1' order by popt.products_options_sort_order]

5 Feb 2009, 11:16 PM
#7
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

You'll now need to go and remove any file modifications that were made

5 Feb 2009, 11:21 PM
#8
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

by file modification, you mean lines added to database._tables.php and product_info.php..... I already changed those back to their original state.

Should I delete all the files that this mod uploaded too?

5 Feb 2009, 11:25 PM
#9
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

I believe the mod you installed had a modified template file:
tpl_modules_attributes.php
that you should have installed at includes/templates/YOUR_TEMPLATE/templates/

If you installed it in that folder, just delete it.
If you overwrote the original cart file at includes/templates/template_default/templates/tpl_modules_attributes.php you will have to upload a fresh, unmodified copy.

5 Feb 2009, 11:25 PM
#10
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Thanks for helping me with this by the way, I hope you can help me get it back the way it was..

It installed a bunch of php files in the /includes/classes folder, but when I rename them it completely deletes the product page view altogether.

5 Feb 2009, 11:29 PM
#11
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Hey, BUNYIP, you're a genius and I love you!! If I could buy you a drink right now I promise it'd be a bottle of the finest.

Thank you so much for helping me there, I was sure it was s disaster...

I need to be careful what mods I install!!

THANK YOU!!

5 Feb 2009, 11:32 PM
#12
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

limelites:

I need to be careful what mods I install!!

You should always install mods on a test site first - NEVER on a live site, and ALWAYS after making a backup...

5 Feb 2009, 11:34 PM
#13
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

I know, I've been working on this site (my first website btw) for a week now and I don't have a backup yet.

It's almost ready to start uploading our full range of products so tonight I will FTP the whole site to my HDD.

Then, tomorrow I'll create a test site in a sub folder for future testing of mods. GREAT IDEA THAT!

Again, thank you for your help, I'm just glad to have the site back the way I built it as it had taken a lot of time and effort.

5 Feb 2009, 11:37 PM
#14
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

I wonder now if the reason that mod was so destructive was that it overwrote my tpl_modules_attributes.php file which I'd heavily edited.

5 Feb 2009, 11:38 PM
#15
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

don't forget - apart from the files, a test site also means a different database (or a set of database tables with different prefix in the same database if your hosting allows you only one database)

5 Feb 2009, 11:38 PM
#16
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

limelites:

I wonder now if the reason that mod was so destructive was that it overwrote my tpl_modules_attributes.php file which I'd heavily edited.

quite likely

5 Feb 2009, 11:47 PM
#17
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

I'm allowed up to 5 databases on the GoDaddy account I'm with, so basically it'd be a complete new install in a different folder.

I always was a daredevil, tempted to try again but this time just edit the new lines into the tpl_modules_attributes.php

Do you think I'd just need to copy in these 70 lines of code into the top of my own file?

<?php /** * Module Template * * Template used to render attribute display/input fields * * @package templateSystem * @copyright Copyright 2003-2005 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_modules_attributes.php 3208 2006-03-19 16:48:57Z birdbrain $ */ ?> <div id="productAttributes"> <?php if ($zv_display_select_option > 0) { ?> <?php $products_attributes = $db->Execute("select count(distinct products_options_id) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = ". (int)$_SESSION['languages_id'] ."");
 if ($products_attributes->fields['total'] > 1)  {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_MULTI;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}
elseif ($products_attributes->fields['total'] > 0) {

  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$_GET['products_id']) ? $_GET['products_id'] : (int)$_GET['products_id']); 
 require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE . '.php');
  $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN_SINGLE;

 $pad = new $class($products_id);
 
 echo $pad->draw();

}

?>

<?php if ($options_attributes_image[$i] != '') { ?> <?php echo $options_attributes_image[$i]; ?> <?php } ?> <br class="clearBoth" /> <?php } ?> <?php if ($show_onetime_charges_description == 'true') { ?>
<div class="wrapperAttribsOneTime"><?php echo TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION; ?></div>
<?php } ?> <?php if ($show_attributes_qty_prices_description == 'true') { ?>
<div class="wrapperAttribsQtyPrices"><?php echo zen_image(DIR_WS_TEMPLATE_ICONS . 'icon_status_green.gif', TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK, 10, 10) . ' ' . '<a href="javascript:popupWindowPrice(\'' . zen_href_link(FILENAME_POPUP_ATTRIBUTES_QTY_PRICES, 'products_id=' . $_GET['products_id'] . '&products_tax_class_id=' . $products_tax_class_id) . '\')">' . TEXT_ATTRIBUTES_QTY_PRICE_HELP_LINK . '</a>'; ?></div>
<?php } ?> </div>
5 Feb 2009, 11:55 PM
#18
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

Re: uninstall SQL patch that's messed up my site

no, I don't think that would work. Pay attention to the div classes that are being used and incorporate them into your stylesheet - you should get what you want that way.

5 Feb 2009, 11:55 PM
#19
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

Never mind, that was bonkers thing to say..... was thinking it was a different file, this one's not so different from my existing one :blush:

5 Feb 2009, 11:57 PM
#20
limelites avatar

limelites

Totally Zenned

Join Date:
Jan 2009
Posts:
2,085
Plugin Contributions:
0

Re: uninstall SQL patch that's messed up my site

It's getting too late for me.. midnight here, so best hit the hay and tackle Zen another day :-)

Thanks so much though for all your help, I'm sure I'll need you again sometime lol...