Post by anaaqti » Tue Aug 08, 2017 12:08 am

hay ,,

in opencart V 3.0.2.0

the table called : oc_event

Please fix the code to match the new database for OC V. 3.0.2.0

Because when I import your file the attachment creates an "event" table without "co_"

Causing full opencart stops

I am sorry for bad my English

Newbie

Posts

Joined
Sun Aug 14, 2016 10:23 pm

Post by luke213 » Tue Aug 08, 2017 12:22 am

Sorry this isn't my cup of tea or job;) But I will tell ya what is going on, my database is old and now that you mention it most newer installs use the prefix "oc_" for the database mine does not. I can't guarantee but this should work if you're running that prefix. Still backup etc so you're not stuck as mentioned before:

Code: Select all

-- phpMyAdmin SQL Dump
-- version 4.1.14.8
-- http://www.phpmyadmin.net
--
-- Host: db000000000.db.1and1.com
-- Generation Time: Aug 05, 2017 at 06:34 PM
-- Server version: 5.5.55-0+deb7u1-log
-- PHP Version: 5.4.45-0+deb7u9

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `db000000000`
--

-- --------------------------------------------------------

--
-- Table structure for table `oc_event`
--

CREATE TABLE IF NOT EXISTS `event` (
  `event_id` int(11) NOT NULL AUTO_INCREMENT,
  `code` varchar(64) NOT NULL,
  `trigger` text NOT NULL,
  `action` text NOT NULL,
  `status` tinyint(1) NOT NULL,
  `sort_order` int(3) NOT NULL,
  PRIMARY KEY (`event_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;

--
-- Dumping data for table `oc_event`
--

INSERT INTO `oc_event` (`event_id`, `code`, `trigger`, `action`, `status`, `sort_order`) VALUES
(1, 'activity_customer_add', 'catalog/model/account/customer/addCustomer/after', 'event/activity/addCustomer', 1, 0),
(2, 'activity_customer_edit', 'catalog/model/account/customer/editCustomer/after', 'event/activity/editCustomer', 1, 0),
(3, 'activity_customer_password', 'catalog/model/account/customer/editPassword/after', 'event/activity/editPassword', 1, 0),
(4, 'activity_customer_forgotten', 'catalog/model/account/customer/editCode/after', 'event/activity/forgotten', 1, 0),
(5, 'activity_transaction', 'catalog/model/account/customer/addTransaction/after', 'event/activity/addTransaction', 1, 0),
(6, 'activity_customer_login', 'catalog/model/account/customer/deleteLoginAttempts/after', 'event/activity/login', 1, 0),
(7, 'activity_address_add', 'catalog/model/account/address/addAddress/after', 'event/activity/addAddress', 1, 0),
(8, 'activity_address_edit', 'catalog/model/account/address/editAddress/after', 'event/activity/editAddress', 1, 0),
(9, 'activity_address_delete', 'catalog/model/account/address/deleteAddress/after', 'event/activity/deleteAddress', 1, 0),
(10, 'activity_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'event/activity/addAffiliate', 1, 0),
(11, 'activity_affiliate_edit', 'catalog/model/account/customer/editAffiliate/after', 'event/activity/editAffiliate', 1, 0),
(12, 'activity_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'event/activity/addOrderHistory', 1, 0),
(13, 'activity_return_add', 'catalog/model/account/return/addReturn/after', 'event/activity/addReturn', 1, 0),
(14, 'mail_transaction', 'catalog/model/account/customer/addTransaction/after', 'mail/transaction', 1, 0),
(15, 'mail_forgotten', 'catalog/model/account/customer/editCode/after', 'mail/forgotten', 1, 0),
(16, 'mail_customer_add', 'catalog/model/account/customer/addCustomer/after', 'mail/register', 1, 0),
(17, 'mail_customer_alert', 'catalog/model/account/customer/addCustomer/after', 'mail/register/alert', 1, 0),
(18, 'mail_affiliate_add', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate', 1, 0),
(19, 'mail_affiliate_alert', 'catalog/model/account/customer/addAffiliate/after', 'mail/affiliate/alert', 1, 0),
(20, 'mail_voucher', 'catalog/model/checkout/order/addOrderHistory/after', 'extension/total/voucher/send', 1, 0),
(21, 'mail_order_add', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order', 1, 0),
(22, 'mail_order_alert', 'catalog/model/checkout/order/addOrderHistory/before', 'mail/order/alert', 1, 0),
(23, 'statistics_review_add', 'catalog/model/catalog/review/addReview/after', 'event/statistics/addReview', 1, 0),
(24, 'statistics_return_add', 'catalog/model/account/return/addReturn/after', 'event/statistics/addReturn', 1, 0),
(25, 'statistics_order_history', 'catalog/model/checkout/order/addOrderHistory/after', 'event/statistics/addOrderHistory', 1, 0),
(26, 'admin_mail_affiliate_approve', 'admin/model/customer/customer_approval/approveAffiliate/after', 'mail/affiliate/approve', 1, 0),
(27, 'admin_mail_affiliate_deny', 'admin/model/customer/customer_approval/denyAffiliate/after', 'mail/affiliate/deny', 1, 0),
(28, 'admin_mail_customer_approve', 'admin/model/customer/customer_approval/approveCustomer/after', 'mail/customer/approve', 1, 0),
(29, 'admin_mail_customer_deny', 'admin/model/customer/customer_approval/denyCustomer/after', 'mail/customer/deny', 1, 0),
(30, 'admin_mail_reward', 'admin/model/customer/customer/addReward/after', 'mail/reward', 1, 0),
(31, 'admin_mail_transaction', 'admin/model/customer/customer/addTransaction/after', 'mail/transaction', 1, 0),
(32, 'admin_mail_return', 'admin/model/sale/return/addReturn/after', 'mail/return', 1, 0),
(33, 'admin_mail_forgotten', 'admin/model/user/user/editCode/after', 'mail/forgotten', 1, 0);

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
If that doesn't work you may have change "PRIMARY KEY (`event_id`)" to "PRIMARY KEY (`oc_event_id`)" but I didn't go dig into the database to look if that's the syntax there. I don't have a store running using a database with oc_ prefix so I can't really look at it without installing a fresh store to check. Also you should be able to drop that table you added without the oc prefix and it should take off working, actually now that I think about it you dropped the table previous OC_ table. So try importing this if it doesn't work try changing that code I mentioned since I honestly am not sure if that's oc_event_id or just event_id whichever it is in your database is correct but you could also try both and see which works. Either way if you have trouble I'll try and help but beware I'm busy today since it's a Monday and I'm just doing this to help out other guys so it does take bottom priority compared to my actual work;)

Take care!

Luke

User avatar
New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by anaaqti » Tue Aug 08, 2017 1:09 am

hello

thanx for your time

When I import it, gave me an error in all the above modifications

but I took table "oc_event" from new fresh Database and imported it on the main database

I tried sending alerts to clients and worked normally

Thanks for your help
Last edited by anaaqti on Tue Aug 08, 2017 1:14 am, edited 1 time in total.

Newbie

Posts

Joined
Sun Aug 14, 2016 10:23 pm

Post by luke213 » Tue Aug 08, 2017 1:11 am

That is absolutely the right way to do it;) I tried apparently and failed to make a file that would import cleanly;)

But others reading this that's another way to do what I did, just basically do an install and pull the event table from it and import it into your old database and you should be good to go;)

Luke

User avatar
New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by higgyjay » Wed Aug 09, 2017 6:00 pm

Thank you Luke. After hours of trying to fix this I found your post and your 'event' table fix sorted it in 5 minutes.

Like anaaqti I did as your first post said and got a table called 'event' rather than 'oc_event'. To fix it you just click on that table name in the list of table names down the left in PHPMyAdmin. Then at the top click on Operations and under Table Options the first option is 'Rename table to'. I renamed mine to oc_event and that was it. The mail started working immediately - both using the Mail and SMTP settings.

Again thank you Luke. You have saved my sanity!

Jonathan

Newbie

Posts

Joined
Wed Aug 09, 2017 5:53 pm

Post by luke213 » Wed Aug 09, 2017 8:44 pm

It had me questioning my sanity for a while too;) Glad to hear it's sorted for ya;)

Take care

Luke

EDIT Also for guys reading this he's spot on you can just change the name there like mentioned. I'm fairly new to PHPMYADMIN in the past I haven't done much other than actually replacing a database or backup and restore etc. Very seldom have I actually fiddled inside the database for fear of screwing something up. In all my tech years database and programming were the two things I disliked the most, I'm 99% a hardware guy:) But the site sometimes drives me in directions that are outside of my "normal" zone;)

User avatar
New member

Posts

Joined
Thu Jul 08, 2010 2:35 am


Post by linetrace » Fri Aug 18, 2017 7:15 am

Thank you! This fix worked for me (after renaming the table references in the .sql file to 'oc_event'. I checked the source code in GitHub and it looks like an upgrade script has been added (after the 3.0.2.1 beta, unfortunately) to resolve this issue, so hopefully it'll be a non-issue going forward.

Newbie

Posts

Joined
Sat Aug 05, 2017 4:42 am
Location - Winooski, VT, US

Post by vaughnchill » Thu Sep 14, 2017 11:08 am

Ugh, I was hoping dropping that table worked for me, but unfortunately I'm still in the same boat.

Having an issue with the Order Emails not sending to guest. I am receiving a copy for the admin email, but not for the guest. All other emails are working fine (sign up, order update statuses, etc...).

This really sucks. Such a huge feature that does not work is not good! Any help out there would be great!

Thanks.

Newbie

Posts

Joined
Thu Aug 31, 2017 2:11 pm

Post by so2 » Mon Sep 18, 2017 5:35 am

OMG IF I could find you and hug you!!! I have been going nuts the past few weeks trying to find a solution to this error. I finally have emails and they are working without issue. THANK YOU :D

so2
Newbie

Posts

Joined
Wed Mar 08, 2017 4:37 pm
Who is online

Users browsing this forum: No registered users and 6 guests