Error while updating from Awocoupon 3.6.0.12 to 3.6.1.0


  • Default avatar
    niko88    
     6 months ago  last edited 6 months ago
    0

    Hi there,

    as a migration preparation, I wanted to update Awocoupon from 3.6.0.12 to 3.6.10 due to
     Cannot access offset of type string on string

    /is/htdocs/wp1032956_QMIEPZRBDQ/www/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-profile.php:498
    Call stack
    #     Function     Location
    1     ()     JROOT/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-profile.php:498
    2     Awocoupon_Library_Profile->send_email()     JROOT/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-giftcert.php:370
    3     AwoCoupon_Library_Giftcert->generate_auto_email()     JROOT/administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-giftcert.php:170
    4     AwoCoupon_Helper_Estore_Virtuemart_Giftcert->get_order_orderitem_rows()     JROOT/administrator/components/com_awocoupon/awocoupon/library/class-awocoupon-library-giftcert.php:595
    5     AwoCoupon_Library_Giftcert->order_status_changed_accept()     JROOT/administrator/components/com_awocoupon/helper/estore/virtuemart/class-awocoupon-helper-estore-virtuemart-giftcert.php:34
    6     AwoCoupon_Helper_Estore_Virtuemart_Giftcert->order_status_changed()     JROOT/plugins/vmcoupon/awocoupon/awocoupon.php:114
    7     plgVmCouponAwoCoupon->plgVmCouponUpdateOrderStatus()     JROOT/libraries/joomla/event/event.php:70
    8     JEvent->update()     JROOT/libraries/joomla/event/dispatcher.php:160
    9     JEventDispatcher->trigger()     JROOT/administrator/components/com_virtuemart/helpers/vdispatcher.php:39
    10     vDispatcher::trigger()     JROOT/administrator/components/com_virtuemart/models/orders.php:1617
    11     VirtueMartModelOrders->updateStatusForOneOrder()     JROOT/plugins/vmpayment/paypal_checkout/helpers/ppc_order.php:845
    12     PayPalOrder::captureOrder()     JROOT/plugins/vmpayment/paypal_checkout/paypal_checkout.php:397
    13     plgVmPaymentPaypal_checkout->plgVmOnSelfCallFE()     JROOT/administrator/components/com_virtuemart/helpers/vdispatcher.php:75
    14     vDispatcher::directTrigger()     JROOT/components/com_virtuemart/controllers/plugin.php:56
    15     VirtuemartControllerPlugin->display()     JROOT/libraries/src/MVC/Controller/BaseController.php:702
    16     Joomla\CMS\MVC\Controller\BaseController->execute()     JROOT/components/com_virtuemart/virtuemart.php:133
    17     require_once()     JROOT/libraries/src/Component/ComponentHelper.php:402
    18     Joomla\CMS\Component\ComponentHelper::executeComponent()     JROOT/libraries/src/Component/ComponentHelper.php:377
    19     Joomla\CMS\Component\ComponentHelper::renderComponent()     JROOT/libraries/src/Application/SiteApplication.php:194
    20     Joomla\CMS\Application\SiteApplication->dispatch()     JROOT/libraries/src/Application/SiteApplication.php:233
    21     Joomla\CMS\Application\SiteApplication->doExecute()     JROOT/libraries/src/Application/CMSApplication.php:225
    22     Joomla\CMS\Application\CMSApplication->execute()     JROOT/index.php:49

    While installing the update, I encountered:

    Warnung

    Specified key was too long; max key length is 1000 bytes

    Fehler

    Fehler bei der Komponenten-Installation.

    and I don't receive any coupon mails. Opening the module in admin are itself shows:

    Aktuelle Version
    3.6.0.12
    Neue Version
    3.6.1.0

    Datenbank wird aktualisiert. Bitte aktualisieren Sie die Seite nicht.
    Fehler Datenbank aktualisieren

    Can you help me debugging this issue? It's quite critical.
    Regards,
    Niko
  • Your avatar
    seyi    
     6 months ago  last edited 6 months ago
    0

    Hello,

    I think there might be an issue with the table #__awocoupon_history_tmp.  Can you manually install it?  Open up phpmyadmin and on the selected database run the query:

    CREATE TABLE IF NOT EXISTS #__awocoupon_history_tmp (
        `id` INT UNSIGNED NOT NULL auto_increment,
        `estore` VARCHAR(255) NOT NULL,
        `order_id` INT UNSIGNED NOT NULL,
        `is_processed` boolean NOT NULL DEFAULT false,
        `created_at` DATETIME,
        `details` MEDIUMTEXT,
        PRIMARY KEY  ( id ),
        UNIQUE KEY ( estore, order_id ),
        KEY order_id ( order_id )
    );

    Where #__ is your actual database prefix.  I suspect you will get the error.  If you do then run this code:
    CREATE TABLE IF NOT EXISTS #__awocoupon_history_tmp (
        `id` INT UNSIGNED NOT NULL auto_increment,
        `estore` VARCHAR(200) NOT NULL,
        `order_id` INT UNSIGNED NOT NULL,
        `is_processed` boolean NOT NULL DEFAULT false,
        `created_at` DATETIME,
        `details` MEDIUMTEXT,
        PRIMARY KEY  ( id ),
        UNIQUE KEY ( estore, order_id ),
        KEY order_id ( order_id )
    );

    And that should work, if it does, then you can run the update which will skip trying to install the table since it is already installed.
  • Default avatar
    niko88    
     6 months ago
    0

    Hi,
    thanks, your fix provided allowed me to install the update. I am using gift certificates only in the shop, not any other products. Since the update, the creation of new gift certificates do not work. When I place a new order, I can pay and submit the order and I also receive the invoice, but the gift certificate is not sent via mail and I also do not see a new gift certificate created in the order history. Resending old gift certificate works fine.

    Can you give me a hint where and how should I start debugging?

    My installed and activated modules (I am actually wondering why there are so old versions being displayed). Used Virtuemart: 4.2.12.

           
    AwoCoupon
        Administrator     Komponente     3.6.1.0     2024-04-15     Seyi Awofadeju     Unbekannt           10056
           
    AwoCoupon Customer Balance
        Site     Modul     2.0.0     2012-08-10     Seyi Awofadeju     Unbekannt           10228
        
        
    System - AwoCoupon
        Site     Plugin     2.0.2     2016-08-02     Seyi Awofadeju     system           10229
           
    VmCalculation - AwoCoupon
        Site     Plugin     2.0.1     2013-10-31     Seyi Awofadeju     vmcalculation           10078
           
    VMCoupon - AwoCoupon
        Site     Plugin     2.0.2     2017-12-08     Seyi Awofadeju     vmcoupon           10055
           
    VMPayment - AwoCoupon
        Site     Plugin     3.0.0     2017-09-20     Seyi Awofadeju     vmpayment           10058
           
    VmShipment - Awocoupon Free Gift Certificates
        Site     Plugin     2.0.1     2020-12-19     Seyi Awofadeju     vmshipment           10075

    Regards,
    Niko
  • Default avatar
    niko88    
     6 months ago
    0

    Hm, after clearing cookies it started working again and gift certificates are created. But maybe you could have a look at my module list and give me feedback about the old version numbers and if there are modules that I can just remove.
    Thanks for your help!
  • Your avatar
    seyi    
     6 months ago
    0

    Hello,

    Glad it started working.  When you update AwoCoupon, it automatically updates all attached plugins if needed.  So you can be sure they are up to date.  If you were to uninstall them, they would be reinstalled on update.  So if you don't need something just unpublish it.  At the bare minimum you will need vmcoupon - awocouopn, and system - awocoupon.
  • Default avatar
    niko88    
     6 months ago
    0

    Thanks for the update. So is it fine that there are some components showing version number 2.* and have a date of 2013 or even 2017?
  • Your avatar
    seyi    
     6 months ago
    0

    Yes it is fine.  Most of the code is in AwoCoupon component, all those plugins/modules are doing is calling AwoCoupon.  The only time there is really any change is if there is a change in joomla in how a plugin/module works.
  • Default avatar
    niko88    
     6 months ago
    0

    Thanks for clarification!