Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php

Started by Linnic, January 29, 2015, 19:02:52 PM

Previous topic - Next topic

Linnic

Hi everybody!

I want to upgrade my Joomla 2.5.27 to Joomla 3.0, so all my plugins etc. need to be updated: just like Virtemart to version 3.0.3.

What I did today:

1. Making backups
2. I set up a test environment (test.skischoolblueyellow.com/online-shop) and there I did the following:
3. Update VM 2.6.6 to 2.6.14 (This was done without any errors)
4. Update VM 2.6.14 to VM 3.0.3 --> And now I have a problem.

In the frontend I get now the following message:

QuoteWarning: Invalid argument supplied for foreach() in /storage/web/public/sites/test.skischoolblueyellow.com/administrator/components/com_virtuemart/models/customfields.php on line 145

Warning: array_merge(): Argument #2 is not an array in /storage/web/public/sites/test.skischoolblueyellow.com/administrator/components/com_virtuemart/models/customfields.php on line 149

When I open the customfields.php, I am seeing the following things on lines 145 to 149:

foreach($productCustoms as $customfield){
$hkey = (int)$customfield->virtuemart_product_id.$hashCwAttribute;
$_customFieldByProductId[$hkey][] = $customfield;
}
$productCustoms = array_merge($productCustomsCached,$productCustoms);


I really have no idea how to solve this? I googled already and there are more sites with the same warnings, but I doesn't find a solution. Hopefully someone can help me :)?
Thanks!!

Nicole

GJC Web Design

did u click 'Update vm2 order format of customfields to vm3 format' in admin -> tools -> tools?

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

Linnic

Thanks for your Reply!

I just did what you recommended, but then the next warning appeared in the backed:

QuoteWarning: Invalid argument supplied for foreach() in /storage/web/public/sites/test.skischoolblueyellow.com/administrator/components/com_virtuemart/controllers/updatesmigration.php on line 155

I quess that is not right.. ;)?

On line 155 is written:

foreach($rows as $fields){
         $store = '';
         $json = @json_decode($fields['customfield_params']);

GJC Web Design

well it is only a warning - not an error -- mores the point - did it fix the first problem?
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

Linnic


GJC Web Design

apart from the warning do your custom fields work as you want?

If so just get rid of the warning by any of the methods mentioned so often on here.
if not if you set up a new custom field does that work?

then  they haven't migrated properly and will probably need re doing
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

Linnic

All the custom fields are indeed not working on the website, so I have to delete them and want to set up new custom fields.

However when creating a new one, the next error occured (opslaan mislukt = saving error):

QuotevmError: TableCustoms: :opslaan mislukt
Unknown column 'custom_desc' in 'field list' SQL=INSERT INTO `jos_virtuemart_customs` (`virtuemart_custom_id`,`custom_parent_id`,`virtuemart_vendor_id`,`admin_only`,`custom_jplugin_id`,`custom_title`,`custom_tip`,`custom_value`,`custom_desc`,`custom_params`,`field_type`,`is_list`,`is_input`,`is_hidden`,`is_cart_attribute`,`layout_pos`,`published`,`ordering`,`show_title`,`created_on`,`created_by`,`modified_on`,`modified_by`) VALUES ('0','0','1','0','0','TEST','','','TEST2','','S','0','0','0','1','','1','0','1','2015-01-29 21:22:53','42','2015-01-29 21:22:53','42')
failed

Do you think, I have to change something in my database?

* I looked in my database and there I do found the column: "custom_field_desc", but indeed no "custom_desc"...

GJC Web Design

have you clicked the update database tables button in tools? -> 'Install or if necessary update tables'

click no others!
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

Linnic

You are great! Now I don't have any errors anymore!

Now I am just trying to find out the easiest way to make new custom fields like the old 'cart variant'.. ;)

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/