VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: meysam66 on May 02, 2020, 22:48:04 PM

Title: vmError: Model Userfields, state with id COM_VIRTUEMART_SHOPPER_FORM_STATE
Post by: meysam66 on May 02, 2020, 22:48:04 PM
hello i have updated my virtuemart from Version 3.4.2 to version 3.6.10 and now i get this error on top of every order print sheets:

vmError: Model Userfields, state with id COM_VIRTUEMART_USER_FORM_ST_LABEL not found

i have searched the web about it, but i dont understand the cause of it, all the fields about shopper, vendor and the users has a propper value.

does anybody have a clue?
Title: Re: vmError: Model Userfields, state with id COM_VIRTUEMART_SHOPPER_FORM_STATE
Post by: GJC Web Design on May 03, 2020, 11:30:07 AM
it appears to be from the userfields model

function getUserFieldsFilled()

~ line 915 vmError('Model Userfields, state with id '.$_return['fields'][$_fld->name]['value'].' not found');

but which constant  COM_VIRTUEMART_SHOPPER_FORM_STATE or COM_VIRTUEMART_USER_FORM_ST_LABEL ?
you mention both

so something to do with address states
Title: Re: vmError: Model Userfields, state with id COM_VIRTUEMART_SHOPPER_FORM_STATE
Post by: meysam66 on May 03, 2020, 13:18:07 PM
hello, thanks for you reply.

you'r right, i have mentioned the wrong phrase at the subject.
in actual error there is COM_VIRTUEMART_USER_FORM_ST_LABEL, which for me is "address nickname".

i have temporarily solved the issue with deleting that phrase from default value of shopperfield "virtuemart_state_id".

but i still didn't understand the cause, is that code line you have mentiend new to virtuemart?
should i comment that?
and why i dont get an error for other fields that has the phrase "COM_VIRTUEMART_USER_FORM_ST_LABEL" as default value too, like "virtuemart_country_id"?
Title: Re: vmError: Model Userfields, state with id COM_VIRTUEMART_SHOPPER_FORM_STATE
Post by: GJC Web Design on May 03, 2020, 17:04:59 PM
that code has been there forever...

you need to do some digging as to why OM_VIRTUEMART_USER_FORM_ST_LABEL  is being returned for $_return['fields'][$_fld->name]['value']