Error when manually adding credit points


  • Default avatar
    begoña    
     12 days ago
    0

    Hello,

    My system configuration is as follows:

    • Database: MariaDB 10.6.20-MariaDB-log
    • PHP: 8.1.23
    • Joomla: 5.1.4
    • VirtueMart: 4.2.18 11050
    • AwoCoupon: 4.0.1.4
    • AwoRewards: 4.0.0.7


    I am experiencing issues when trying to manually add credit points to a customer.

    The Ajax call made to save the new reward returns a 500 error. Upon examining the response, I see the following text among other details:

    "1292 Incorrect datetime value: 'current_timestamp()' for column jaltorco_joomla.rek6z_aworewards.timestamp at row 1"


    Before updating to VM4, this functionality worked correctly, although I hadn’t needed to manually add rewards in a while.


    Interestingly, if I copy the website to my development server, everything works fine. This is a bit puzzling.
    The development server is a VM with the following specifications:

    • Database: MySQL 8.0.40
    • PHP: 8.1.2
    • Joomla: 5.1.4
    • VirtueMart: 4.2.18 11050
    • AwoCoupon: 4.0.1.4
    • AwoRewards: 4.0.0.7


    Do you have any idea what might be causing this issue or any suggestions on how to troubleshoot it?

    Best regards,
    Carlos

  • Your avatar
    seyi    
     12 days ago
    0

    Hello,

    It works in one and not other because of your differences in database environment:
      Database: MariaDB 10.6.20-MariaDB-log
      Database: MySQL 8.0.40

    To fix, run these queries on your production database:

    ALTER TABLE #__aworewards MODIFY `timestamp` DATETIME;
    ALTER TABLE #__aworewards_payment MODIFY `payment_date` DATETIME;

    Where #__ is your actual database prefix.
  • Default avatar
    begoña    
     7 days ago
    0

    Hi Seyi,

    Problem solved, thank you!!!

    However, I couldn't execute the queries directly because the "timestamp" field contained invalid values for the DATETIME type in all records where points were manually added with version 3.
    I'll leave here how I resolved it in case it can help someone else.

    Find problematic records:

    SELECT * FROM #__aworewards WHERE CAST(timestamp AS CHAR) = '0000-00-00 00:00:00';

    Update the records:

    UPDATE #__aworewards SET timestamp = expiration WHERE CAST(timestamp AS CHAR) = '0000-00-00 00:00:00' AND id > 0;

    Once this was done, I was able to execute the query you provided.

    Carlos.