News:

Looking for documentation? Take a look on our wiki

Main Menu

An error has occurred.

Started by MAD King, April 29, 2022, 23:35:37 PM

Previous topic - Next topic

MAD King

Updated to Version 4 and got this:

Quote
An error has occurred.
0 Call to undefined method TableProducts::setDateFields()

Joomla! 4.3.4
VirtueMart 4.2.4 10922

Milbo

you got that during the installation? Or later? When do you get it?. Enable the JOOMLA Debug, then you should get a trace, which shows where it is called (I need the origin message and the first 5 lines)
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

peter.forensys

Hey guys,

I got the same error when I tried to update VM to 4.0. Then I was a bit confused as in the updates the Virtuemart still appeared but the version said it's already 4.0. Then I hit update again and it updated the component.

I am always a bit afraid of updating Virtuemart as it never happens without error message or problems...

GJC Web Design

Have done a few updates over the last couple of days and one install showed the error

0 Call to undefined method TableProducts::setDateFields()

set all tracing and debug on but sadly the 2nd run the error didn't appear .. everything seems to be be installed correctly .. so looks a hard one to find

It does seem if u run the install again everything is fine
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

T.A. Garrison, LLC

I don't know if this has been resolved, but I have a "different" error and wondered if I could post it here or...?

This is definitely related to updates, although it could be related to the install, but feel free to move this post to where you feel is best.

Everything was working fine until the VM update from (if I remember correctly) May 26, 2022.
I didn't say or do anything about it then because I was trying to run down some answers (and was just too busy).

Mind you, with every update - VM or any other component update - I always get the error about VM Payment - eWay and custom_download

Update: :Extension: Could not parse http://virtuemart.net/releases/vm3/plg_vmpayment_eway_update.xml
Update: :Extension: Could not parse http://virtuemart.net/releases/vm3/plg_vmcustom_download_simple_update.xml

I have the eWay plugin unpublished. Obviously, it makes no difference if it's unpublished because the coding is trying to update eWay and cannot. Hence the error.
That's been happening since the first week I installed VM. I "live" with that error because I keep thinking it's going to be fixed with "the next VM update". There have been 2 thus far (since I started getting the error) and the error continues.


I'm running J4.1.4, and VM 4.0.2 10661 on Php 8.
I'm using J4 SEF and no other plugin for that.
I turned off J4 Conservative cache last week when the system started having the VM issue.
Oh...and there are 55 overrides that need to be "checked" in order for the blaring red notice to relax. All 55 of those overrides are from a previous VM update. Again, I hoped the "next" update would resolve that. Since it did not, I have to find the time to go into the database and change the "0" to "1" in each of those updated files...sigh... Well, at the bottom of this post I state that I'm planning to reinstall VM after removing it completely, along with all my products. So I'll leave the db alone for now.

Here is what started me scratching my head.
When I updated, I noticed on the front end that the link to the "Categories view" didn't work right.
Since there is now only the one option, I have the main menu link - Services - set to "Category Layout" with "Top Level Category". That's been working fine for the few months I've had VM installed with J4.
When a user clicked on either of the 2 listed categories, the user would go to the 1 category and see anything assigned to that category.

When I updated, that changed.
Keeping the menu unchanged, I arrived at the categories and products listed - that remained normal.
But when I click on "either" of the categories, I remain on the same page I was brought to from the "Services" link in the main menu.

Looking at the URI when just hovering either of the category icons, in fact, it is the same page as the main menu "Services". That means that now there is no way to get to 1 category or the other. The user is "stuck" on the page with all (in my case 2) categories and all products.

Because I know that there are changes happening with VM in this version, I thought I'd just do some debugging and investigating to see if anything raised any flags.
Before I updated on May 26, I had set a couple of products with the appropriate canonical.

Today, when I attempted to look for any errors with debug, I didn't find any until I went to change the canonical to "No override".
VM was NOT happy!!

danger
vmError: vmTable store updateObject Incorrect integer value: '' for column `dbusername_tagnew`.`dd6nm_virtuemart_products`.`product_canon_category_id` at row 1 UPDATE `dd6nm_virtuemart_products` SET `virtuemart_vendor_id`='1',`product_parent_id`='0',`product_sku`='DDS',`product_gtin`='',`product_mpn`='',`product_weight`=NULL,`product_weight_uom`='KG',`product_length`=NULL,`product_width`=NULL,`product_height`=NULL,`product_lwh_uom`='M',`product_url`='',`product_in_stock`='1000',`product_ordered`='0',`product_stockhandle`='0',`low_stock_notification`='0',`product_available_date`='2022-04-19 00:00:00',`product_availability`='',`product_special`='0',`product_discontinued`='0',`pordering`='0',`product_sales`='0',`product_unit`='KG',`product_packaging`=NULL,`product_params`='min_order_level=\"\"|max_order_level=\"\"|step_order_level=\"\"|shared_stock=0|product_box=\"\"|',`intnotes`='',`metarobot`='',`metaauthor`='',`layout`='default',`published`='1',`has_categories`='1',`has_manufacturers`='0',`has_medias`='1',`has_prices`='1',`has_shoppergroups`='0',`product_canon_category_id`='',`created_on`='2022-04-28 23:58:04',`created_by`='194',`modified_on`='2022-06-02 19:28:52',`modified_by`='194' WHERE `virtuemart_product_id` = '6'


I got that error as soon as I hit "Save".
And, the product I attempted to change reverted back to what it was set before I attempted to change the canonical.

Further, using "Log Almost Everything", I checked the server log and found the following:
2022-06-02 19:28:52 ERROR vmError: vmTable store updateObject Incorrect integer value: '' for column `dbusername_tagnew`.`dd6nm_virtuemart_products`.`product_canon_category_id` at row 1 UPDATE `dd6nm_virtuemart_products` SET `virtuemart_vendor_id`='1',`product_parent_id`='0',`product_sku`='DDS',`product_gtin`='',`product_mpn`='',`product_weight`=NULL,`product_weight_uom`='KG',`product_length`=NULL,`product_width`=NULL,`product_height`=NULL,`product_lwh_uom`='M',`product_url`='',`product_in_stock`='1000',`product_ordered`='0',`product_stockhandle`='0',`low_stock_notification`='0',`product_available_date`='2022-04-19 00:00:00',`product_availability`='',`product_special`='0',`product_discontinued`='0',`pordering`='0',`product_sales`='0',`product_unit`='KG',`product_packaging`=NULL,`product_params`='min_order_level=\"\"|max_order_level=\"\"|step_order_level=\"\"|shared_stock=0|product_box=\"\"|',`intnotes`='',`metarobot`='',`metaauthor`='',`layout`='default',`published`='1',`has_categories`='1',`has_manufacturers`='0',`has_medias`='1',`has_prices`='1',`has_shoppergroups`='0',`product_canon_category_id`='',`created_on`='2022-04-28 23:58:04',`created_by`='194',`modified_on`='2022-06-02 19:28:52',`modified_by`='194' WHERE `virtuemart_product_id` = '6'<pre>#0  vmError() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1289]
#1  VmTable->store() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1978]
#2  VmTable->bindChecknStoreNoLang() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1870]
#3  VmTable->bindChecknStore() called at [/server/username/public_html/administrator/components/com_virtuemart/models/product.php:2560]
</pre>


I'm going out on a limb here and saying, it would seem that only a clean install would be the best option.
However, there's no point in doing that until I can get Milbo (or ?) to authorize that without doing anything prior to a fresh install.
I'm guessing you would all like to  review this information and make any appropriate changes before I attempt a new install - which means throwing out all my products and starting over. "Stuff" happens...

Ok. What more do you need? I'm ready to provide whatever, even access to admin.

Thanks.
T.A. Garrison, LLC
3150 Orleans St. # 28261
Bellingham, WA 98228

T.A. Garrison, LLC

...chirp chirp....

Did I post badly? Or did I make everybody think so hard they can't respond?
T.A. Garrison, LLC
3150 Orleans St. # 28261
Bellingham, WA 98228

Milbo

#6
Quote from: T.A. Garrison, LLC on June 02, 2022, 22:41:12 PM
Mind you, with every update - VM or any other component update - I always get the error about VM Payment - eWay and custom_download

Update: :Extension: Could not parse http://virtuemart.net/releases/vm3/plg_vmpayment_eway_update.xml
Update: :Extension: Could not parse http://virtuemart.net/releases/vm3/plg_vmcustom_download_simple_update.xml
Alright, I have to upload this xml files to prevent this error. At the end, it is a false alert.

Quote from: T.A. Garrison, LLC on June 02, 2022, 22:41:12 PM
I'm running J4.1.4, and VM 4.0.2 10661 on Php 8.
I'm using J4 SEF and no other plugin for that.
I turned off J4 Conservative cache last week when the system started having the VM issue.
Disabling the cache makes problems? that is new

Quote from: T.A. Garrison, LLC on June 02, 2022, 22:41:12 PM
Oh...and there are 55 overrides that need to be "checked" in order for the blaring red notice to relax.
I told you already, that the joomla tool checking for changed files is tooo sensitive. There was no real change, maybe a space more in one line, or so. I cannot prevent that, write this in the joomla forum that their new tools is making false alerts.

Quote from: T.A. Garrison, LLC on June 02, 2022, 22:41:12 PM

I got that error as soon as I hit "Save".
And, the product I attempted to change reverted back to what it was set before I attempted to change the canonical.

Further, using "Log Almost Everything", I checked the server log and found the following:
2022-06-02 19:28:52 ERROR vmError: vmTable store updateObject Incorrect integer value: '' for column `dbusername_tagnew`.`dd6nm_virtuemart_products`.`product_canon_category_id` at row 1 UPDATE `dd6nm_virtuemart_products` SET `virtuemart_vendor_id`='1',`product_parent_id`='0',`product_sku`='DDS',`product_gtin`='',`product_mpn`='',`product_weight`=NULL,`product_weight_uom`='KG',`product_length`=NULL,`product_width`=NULL,`product_height`=NULL,`product_lwh_uom`='M',`product_url`='',`product_in_stock`='1000',`product_ordered`='0',`product_stockhandle`='0',`low_stock_notification`='0',`product_available_date`='2022-04-19 00:00:00',`product_availability`='',`product_special`='0',`product_discontinued`='0',`pordering`='0',`product_sales`='0',`product_unit`='KG',`product_packaging`=NULL,`product_params`='min_order_level=\"\"|max_order_level=\"\"|step_order_level=\"\"|shared_stock=0|product_box=\"\"|',`intnotes`='',`metarobot`='',`metaauthor`='',`layout`='default',`published`='1',`has_categories`='1',`has_manufacturers`='0',`has_medias`='1',`has_prices`='1',`has_shoppergroups`='0',`product_canon_category_id`='',`created_on`='2022-04-28 23:58:04',`created_by`='194',`modified_on`='2022-06-02 19:28:52',`modified_by`='194' WHERE `virtuemart_product_id` = '6'<pre>#0  vmError() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1289]
#1  VmTable->store() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1978]
#2  VmTable->bindChecknStoreNoLang() called at [/server/username/public_html/administrator/components/com_virtuemart/helpers/vmtable.php:1870]
#3  VmTable->bindChecknStore() called at [/server/username/public_html/administrator/components/com_virtuemart/models/product.php:2560]
</pre>


Ah this j4 with this strict db setting. I need to check why this int is wrong, maybe it is "" and that is not allowed anylonger. Stress for nothing.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

MAD King

#7
As of today, Wednesday, June 22, 2022, this error still exists when updating to 4.0.2:

QuoteAn error has occurred.
0 Call to undefined method TableProducts::setDateFields()



Joomla! 3.10.10
VM 3.8.8
Joomla! 4.3.4
VirtueMart 4.2.4 10922

MAD King

I managed to update to VM 4.0.2 by uploading manually, but now it broke the VirtueMart Products module

QuoteDisplays: Featured, Best Sales, Random, Latest or Recently Viewed products.

(VirtueMart 2+ compatible)


QuoteWarning: count(): Parameter must be an array or an object that implements Countable in /public_html/components/com_virtuemart/helpers/shopfunctionsf.php on line 474
COM_VIRTUEMART_0_PRODUCT
COM_VIRTUEMART_1_PRODUCT
COM_VIRTUEMART_2_PRODUCT
COM_VIRTUEMART_3_PRODUCT
Joomla! 4.3.4
VirtueMart 4.2.4 10922

Milbo

If you uploaded the files manually, maybe you can do the install now? Or maybe just wait for the next version, I think there was an error in the vm system plugin.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

MAD King

#10
Thanks, Milbo. Any idea when You will release the next version?
Joomla! 4.3.4
VirtueMart 4.2.4 10922

Jumbo!

Quote from: MAD King on June 22, 2022, 14:54:22 PM
I managed to update to VM 4.0.2 by uploading manually, but now it broke the VirtueMart Products module

QuoteDisplays: Featured, Best Sales, Random, Latest or Recently Viewed products.

(VirtueMart 2+ compatible)


QuoteWarning: count(): Parameter must be an array or an object that implements Countable in /public_html/components/com_virtuemart/helpers/shopfunctionsf.php on line 474
COM_VIRTUEMART_0_PRODUCT
COM_VIRTUEMART_1_PRODUCT
COM_VIRTUEMART_2_PRODUCT
COM_VIRTUEMART_3_PRODUCT

Open - components/com_virtuemart/helpers/vmview.php

Find the following codes between lines 128 to 187:

static public function getVmSubLayoutPath($name){

static $layouts = array();

if(isset($layouts[$name])){
return $layouts[$name];
} else {
$vmStyle = VmTemplate::loadVmTemplateStyle();
$template = $vmStyle['template'];

// get the template and default paths for the layout if the site template has a layout override, use it


$tP = VMPATH_ROOT .'/templates/'. $template .'/html/com_virtuemart/sublayouts/';//. $name .'.php';
$nP = VMPATH_SITE .'/sublayouts/';

if(!isset(VmView::$bs)){
VmView::$bs = VmConfig::get('bootstrap','');
VmView::$override = VmConfig::get('useLayoutOverrides',1);
vmdebug('VmView loaded with override and bootstrap version',(int) VmView::$override, VmView::$bs);
}

if(VmView::$bs!=='') {
$bsLayout = VmView::$bs . '-' . $name;
if (VmView::$override and JFile::exists($tP . $bsLayout . '.php')) {
$layouts[$name] = $tP . $bsLayout . '.php';
//vmdebug(' getVmSubLayoutPath using '.VmView::$bs.' tmpl layout override ',$layouts[$name]);
return $layouts[$name];
}
}

//If a normal template overrides exists, use the template override
if ( VmView::$override and JFile::exists ($tP. $name .'.php')) {
$layouts[$name] = $tP . $name . '.php';
//vmdebug(' getVmSubLayoutPath using tmpl layout override ',$layouts[$name]);
return $layouts[$name];
}

if(VmView::$bs!=='') {
if (JFile::exists ($nP. $bsLayout . '.php')) {
$layouts[$name] = $nP. $bsLayout . '.php';
//vmdebug(' getVmSubLayoutPath using '.VmView::$bs.' core layout ',$layouts[$name]);
return $layouts[$name];
}
}

if(JFile::exists ($nP. $name . '.php')) {
$layouts[$name] = $nP. $name .'.php';
//vmdebug(' getVmSubLayoutPath using standard core ',$layouts[$name]);
} else {
$layouts[$name] = false;
//VmConfig::$echoDebug = true;
//vmdebug(' getVmSubLayoutPath layout NOOOT found ',$lName);
vmError('getVmSubLayoutPath layout '.$name.' not found ');
}

return $layouts[$name];
}

}


Replace the above by:

static public function getVmSubLayoutPath($name) {
static $layouts = array();

if(!isset(VmView::$bs)){
VmView::$bs = VmConfig::get('bootstrap','');
VmView::$override = VmConfig::get('useLayoutOverrides',1);
vmdebug('VmView loaded with override and bootstrap version',(int) VmView::$override, VmView::$bs);
}

if(isset($layouts[$name])){
return $layouts[$name];
} else {
$vmStyle = VmTemplate::loadVmTemplateStyle();
$template = $vmStyle['template'];

// get the template and default paths for the layout if the site template has a layout override, use it

$tP = VMPATH_ROOT .'/templates/'. $template .'/html/com_virtuemart/sublayouts/';//. $name .'.php';
$nP = VMPATH_SITE .'/sublayouts/';

if(VmView::$bs!=='') {
$bsLayout = VmView::$bs . '-' . $name;
if (VmView::$override and JFile::exists($tP . $bsLayout . '.php')) {
$layouts[$name] = $tP . $bsLayout . '.php';
//vmdebug(' getVmSubLayoutPath using '.VmView::$bs.' tmpl layout override ',$layouts[$name]);
return $layouts[$name];
}
}

//If a normal template overrides exists, use the template override
if ( VmView::$override and JFile::exists ($tP. $name .'.php')) {
$layouts[$name] = $tP . $name . '.php';
//vmdebug(' getVmSubLayoutPath using tmpl layout override ',$layouts[$name]);
return $layouts[$name];
}

if(VmView::$bs!=='') {
if (JFile::exists ($nP. $bsLayout . '.php')) {
$layouts[$name] = $nP. $bsLayout . '.php';
//vmdebug(' getVmSubLayoutPath using '.VmView::$bs.' core layout ',$layouts[$name]);
return $layouts[$name];
}
}

if(JFile::exists ($nP. $name . '.php')) {
$layouts[$name] = $nP. $name .'.php';
//vmdebug(' getVmSubLayoutPath using standard core ',$layouts[$name]);
} else {
$layouts[$name] = false;
//VmConfig::$echoDebug = true;
//vmdebug(' getVmSubLayoutPath layout NOOOT found ',$lName);
vmError('getVmSubLayoutPath layout '.$name.' not found ');
}

return $layouts[$name];
}
}


This will resolve the issue.

MAD King

wow, Jumbo. Excellent support on your website with your templates and addons, and now here.
You need to get a medal.

Thank you very much.
Joomla! 4.3.4
VirtueMart 4.2.4 10922

Jumbo!

Quote from: MAD King on June 23, 2022, 15:39:29 PM
wow, Jumbo. Excellent support on your website with your templates and addons, and now here.
You need to get a medal.

Thank you very much.

You are most welcome.

Milbo

He just does not write it in the dev chat ... so pure luck if it comes into the next core, or not.

I also do not understand the difference. at begin no layout is set, so it must use the "else" case runs through the "!isset(VmView::$bs)) case. So I do not understand how it makes a difference if you load it always. I just placed it below the

if(isset($layouts[$name])){
return $layouts[$name];
} else {

case, so that it is not checked if it should return an already cached layout, which again means, that the if(!isset(VmView::$bs)){ was done.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/