VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: scriner on December 06, 2022, 11:10:19 AM

Title: vmTable store insertObject when try to use "Notify me"
Post by: scriner on December 06, 2022, 11:10:19 AM
Hello

J 4.2.5, VM / 4.0.8 10748

When I try to use "Notify me" function, after adding email nad press button I got message that "vmTable store insertObject" and "Notify me successfully saved", but no email added to notify list.

I have this error only on J4. There are no errors on J3 with same version VM. I see this error during monthes from first VM 4 release. I thought that it is already fixed but still see it now.

I have clean install of VM and don't think that it is problem of my website. Any other have this error?

Title: Re: vmTable store insertObject when try to use "Notify me"
Post by: Milbo on December 06, 2022, 21:45:09 PM
Thank you for your bug report. You checked with j3 that helped me a lot. If you would have logged in, you even would have get the real Error message:

Quote
vmError: vmTable store insertObject #__virtuemart_waitingusers Incorrect datetime value: '' for column `vm3j4_db`.`pa3b1_virtuemart_waitingusers`.`notify_date` at row 1 INSERT INTO `pa3b1_virtuemart_waitingusers` (`virtuemart_waitinguser_id`,`virtuemart_product_id`,`virtuemart_user_id`,`notify_email`,`notified`,`notify_date`,`ordering`,`created_on`,`created_by`) VALUES ('0','156','369','admin@test.local','0','','0','2022-12-06 20:43:26','369')

is fixed, just a simple line for j4 in the constructor of the table

$this->setDateFields(array('notify_date'));
Title: Re: vmTable store insertObject when try to use "Notify me"
Post by: Milbo on December 06, 2022, 21:47:24 PM
Acutally. I think the admin message should be even in your VM logs. :-) Just "for your information" in the future and with you, I mean, anyone reading here :-)
Title: Re: vmTable store insertObject when try to use "Notify me"
Post by: scriner on December 07, 2022, 05:50:58 AM
Quote from: Milbo on December 06, 2022, 21:45:09 PM
Thank you for your bug report. You checked with j3 that helped me a lot. If you would have logged in, you even would have get the real Error message:

Quote
vmError: vmTable store insertObject #__virtuemart_waitingusers Incorrect datetime value: '' for column `vm3j4_db`.`pa3b1_virtuemart_waitingusers`.`notify_date` at row 1 INSERT INTO `pa3b1_virtuemart_waitingusers` (`virtuemart_waitinguser_id`,`virtuemart_product_id`,`virtuemart_user_id`,`notify_email`,`notified`,`notify_date`,`ordering`,`created_on`,`created_by`) VALUES ('0','156','369','admin@test.local','0','','0','2022-12-06 20:43:26','369')

is fixed, just a simple line for j4 in the constructor of the table

$this->setDateFields(array('notify_date'));


Hello Milbo,

Thanks for information, I will check logs first now.

But, please, say which exact file and which line needs to fix?

2022-12-06 09:42:08 ERROR vmError: vmTable store insertObject #__virtuemart_waitingusers Field 'notify_phone' doesn't have a default value INSERT INTO `joom_virtuemart_waitingusers`
(`virtuemart_waitinguser_id`,`virtuemart_product_id`,`virtuemart_user_id`,`notify_email`,`notified`,`notify_date`,`ordering`,`created_on`,`created_by`) VALUES
('0','17','0','scriner@mail.ru','0','','0','2022-12-06 09:42:08','0')<pre>#0  vmError() called at [/var/www/vhosts/v-9789.webspace/www/kingsmith.kz/administrator/components/com_virtuemart/helpers/vmtable.php:1305]
#1  VmTable->store() called at [/var/www/vhosts/v-9789.webspace/www/kingsmith.kz/administrator/components/com_virtuemart/models/waitinglist.php:146]
#2  VirtueMartModelWaitingList->adduser() called at [/var/www/vhosts/v-9789.webspace/www/kingsmith.kz/components/com_virtuemart/controllers/productdetails.php:349]
#3  VirtueMartControllerProductdetails->notifycustomer() called at [/var/www/vhosts/v-9789.webspace/www/kingsmith.kz/libraries/src/MVC/Controller/BaseController.php:672]
#4  Joomla\CMS\MVC\Controller\BaseController->execute() called at [/var/www/vhosts/v-9789.webspace/www/kingsmith.kz/components/com_virtuemart/virtuemart.php:128]
</pre>

It may be vmtable.php? I tried to fix by myself, but have no success.
Title: Re: vmTable store insertObject when try to use "Notify me"
Post by: Milbo on December 08, 2022, 23:18:12 PM
The fix is here https://dev.virtuemart.net/attachments/1355/com_virtuemart.4.0.10.10767_package_or_extract.zip

and here is the diff  https://dev.virtuemart.net/projects/virtuemart/repository/revisions/10767/diff/trunk/virtuemart/administrator/components/com_virtuemart/tables/waitingusers.php
Title: Re: vmTable store insertObject when try to use "Notify me"
Post by: scriner on December 09, 2022, 07:45:02 AM
Quote from: Milbo on December 08, 2022, 23:18:12 PM
The fix is here https://dev.virtuemart.net/attachments/1355/com_virtuemart.4.0.10.10767_package_or_extract.zip

and here is the diff  https://dev.virtuemart.net/projects/virtuemart/repository/revisions/10767/diff/trunk/virtuemart/administrator/components/com_virtuemart/tables/waitingusers.php

Thank you.

Problem solved. It is one more little step for better virtuemart.