I have added a menu item - List Orders but when I click to view an order there are errors reported for each item on the order:
Warning: key() [function.key]: Passed variable is not an array or object in /--- website ---/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253
I get the same result if I click on the 'view your order online' link in the confirmation email that is sent to the customer.
Using VM2.0.0
Edit - It only seems to happen when the product has custom fields!
Get the same here
[attachment cleanup by admin]
Quote from: trevorsm on December 22, 2011, 20:07:09 PM
I have added a menu item - List Orders but when I click to view an order there are errors reported for each item on the order:
Warning: key() [function.key]: Passed variable is not an array or object in /--- website ---/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253
I get the same result if I click on the 'view your order online' link in the confirmation email that is sent to the customer.
Using VM2.0.0
Edit - It only seems to happen when the product has custom fields!
fixed At revision: 5167
Hallo! Ich habe das selbe Problem, wollte mal nachfragen, was das Revision 5167 bedeutet und wie ich das einbinden kann, damit der Fehler nicht mehr passiert.
English (not good:-)) Hello, i have the same Problem. What is the fixed 5167. How i become it? Thanks!
Quote from: Norman27 on December 30, 2011, 19:10:47 PM
Hallo! Ich habe das selbe Problem, wollte mal nachfragen, was das Revision 5167 bedeutet und wie ich das einbinden kann, damit der Fehler nicht mehr passiert.
English (not good:-)) Hello, i have the same Problem. What is the fixed 5167. How i become it? Thanks!
on the next update, OR if you use SVN
https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart/
Hello!
I changed the file now. However, the error message comes back, but now 254th in line The line was also added new and is called: if (key ($ plg) == $ this-> _name)
Hope you can help me.
greeting
Norman
I did have the same error, found it it was either the custom field was deleted or altered, or it wasnt configured the right way, try to delete the custom field and make a new one and see, also empty the cache.
Cheers!
FORGET THE ABOVE!!1 the error came back, also in backend print view it displays this {"429":" Choose a colour : <\/span>62"} VM 2.0 and J1.5.X
Hi, does someone could solve this problem ?
I still have this problem. I tried:
- install the last custom fields files (taking into account revision 5167)
- empty the cache
- create a new simple custom field (color field with 2 colors)
- create a new simple product with only the new custom field
The error message remain the same in back-end (no problem in confirmation e-mails):
Warning: key() expects parameter 1 to be array, string given in /homez.398/stickerv/www/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253
I'm lost :-(
I updated to the latest version from the svn two days ago and it it seems to work OK now.
I replace the file and I get the same error to an other line (196 vs 253) in this file:
Warning: key() expects parameter 1 to be array, string given in /homez.398/stickerv/www/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 196
(I use J1.7)
I think there might be more than one file involved. I updated all the files from the svn.
I cannot replace all files because i'm customizing some php for my needs: I'd like to know which files are involved....
Upgrade with new release 2.0.1 and it will fix the problem. Save before for your customized files
Hi,
i Updated the VM 2.0.1, the error atoped, but i lose the products and categories imagens and details (Images, Custon Fields...)
Any ideia
Thanks
Bruno
go to "shop media files" and publish all images
@Electrocity
QuoteI have added a menu item - List Orders but when I click to view an order there are errors reported for each item on the order:
Code: [Select]
Warning: key() [function.key]: Passed variable is not an array or object in /--- website ---/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 253
I get the same result if I click on the 'view your order online' link in the confirmation email that is sent to the customer.
Using VM2.0.0
Edit - It only seems to happen when the product has custom fields!
fixed At revision: 5167
Since the problem is to be found i VM 2.0 and I tried the VM 2.0.1 which created new sets of problems - then I am forced to stay on with 2.0 for a while.
Could we might get an insight into which files have to be edited and with what so we can fix it on a VM 2.0 version?
This issue blackout customer (view order) and shopadmin (backend list orders) to see which item is ordered (custom field - image for instance)
Please...(tried as above to replace content of that single file vmcustomplugin.php with the new one fram 2.0.1 but of course that not worked just moved error to :
/public_html/dev/administrator/components/com_virtuemart/plugins/vmcustomplugin.php on line 196)
A very dirty fix (or rather hiding of this issue) for VM 2.0
I replaced content with VM 2.0 content of VM 2.0.1 files
/administrator/components/com_virtuemart/models/customfields.php
/administrator/components/com_virtuemart/plugins/vmcustomplugin.php
Went into the
/administrator/components/com_virtuemart/plugins/vmcustomplugin.php
Edited:
line 188
Quotepublic function GetPluginInCart($product){
//$plgName = $productCustom->value;
if(!empty($product->param)){
if (!is_array($product->param)) return false ;
$param = array() ;
foreach($product->param as $k => $plg){
if (key($plg)== $this->_name)
$param[$k]= $plg[$this->_name];
}
if ($param ) return $param ;
}
return null ;
}
to
Quotepublic function GetPluginInCart($product){
//$plgName = $productCustom->value;
//if(!empty($product->param)){
//if (!is_array($product->param)) return false ;
//$param = array() ;
//foreach($product->param as $k => $plg){
//if (key($plg)== $this->_name)
//$param[$k]= $plg[$this->_name];
//}
//if ($param ) return $param ;
//}
return null ;
}
Now at least me and customers do not have to look at the error message and the custom filed type image is shown with image title...
I did not test where this is going to break some other stuff.
EDIT::::::::::::::::::::::::::::::::::::::::::::::::
hmmm.. this seems to have broken custom field type string on the frontend
:O
Hi BanquetTables.pro,
Thanks. Working :)
But i found other problems/bug:
In product detail, the thumbnail image open with big dimensons.
The custon fieds not show in product Details.
Thanks
Bruno
Hi BanquetTables.pro,
This is an interesting solution... For me this is not usefull because the fields "Text input" (what customers have to fill in) disappear on front-end.
This problem was bought to my attention by a customer of mine, for whom the existing solution on this page was not sufficient.
The following code fixes the error and displays the custom fields.
public function GetPluginInCart($product){
//$plgName = $productCustom->value;
if(!empty($product->param)){
$param = array() ;
foreach($product->param as $k => $plg){
//if ($plg == $this->_name)
$param[]= $plg;
}
if ($param ) return $param ;
}
return null ;
}
I'm having this error too for every product listed.
Can I just ask, where exactly are you getting VM 2.0.1 from? In the admin area it says that VM 2.0.0. is the latest version. Same on the VM website under downloads the only latest option is VM 2.0.0.
So where are you getting VM 2.0.1 from?