VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: Linnic on January 29, 2015, 19:02:52 PM

Title: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Linnic on January 29, 2015, 19:02:52 PM
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
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: GJC Web Design on January 29, 2015, 19:43:02 PM
did u click 'Update vm2 order format of customfields to vm3 format' in admin -> tools -> tools?

Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Linnic on January 29, 2015, 21:55:18 PM
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']);
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: GJC Web Design on January 29, 2015, 21:57:32 PM
well it is only a warning - not an error -- mores the point - did it fix the first problem?
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Linnic on January 29, 2015, 22:02:18 PM
No, I still got the same errors on the frontend..
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: GJC Web Design on January 29, 2015, 22:04:27 PM
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
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Linnic on January 29, 2015, 22:25:38 PM
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"...
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: GJC Web Design on January 29, 2015, 22:52:47 PM
have you clicked the update database tables button in tools? -> 'Install or if necessary update tables'

click no others!
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Linnic on January 29, 2015, 23:09:58 PM
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'.. ;)
Title: Re: Virtuemart 2.6.6/2.6.14 to 3.0.3 - Frontend Warning: customfields.php
Post by: Milbo on February 01, 2015, 16:21:23 PM
Update to vm3.0.4, vm3.0.3 was a kind of interims version