[Skip to main content](#vessel-content)

#   Manage Variant Error

##

- **[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")**
- [![BasketBox's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11810-basketbox "View BasketBox's Profile") Topic Author
- [ Offline](/forum/user/11810-basketbox)

Less More

- Posts: 69
- Thank you received: 1
-
-

13 years 9 months ago [\#86284](#86284) by [BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")  *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#86284 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")* was created by *[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")*

When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in /home/basket/public_html/libraries/joomla/environment/request.php on line 649

Plus when I copy a product to use for a new one, the variants that were also copied will include a price that was not in the original copied product. In fact there was no price for the original copied variant.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 9 months ago [\#86321](#86321) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#86321 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Hi,

I think that you'll maybe find some solutions [ there](http://www.hikashop.com/fr/forum/3-bug-report/25606-product-options-error.html) :

> I would say that this comes from the fact that you have the register globals option of your php turned on, which you shouldn't. Because of that, the option variable we use in our view overwrites the option variable that joomla uses on it end and thus you can that error.
>
> Three solutions:
> 1\. you change that line by:
> $option = preg\_replace('/\[^A-Z0-9\_\\.-\]/i', '', JRequest::getString('option'));
>
> 2\. You edit the file option of the view product via the menu Display-&gt;Views and you change the variable $option by $optionElement to avoid the conflict.
>
> 3\. You deactivate that php option, supposing that you have access to your php.ini

Hope this will help you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")**
- [![BasketBox's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11810-basketbox "View BasketBox's Profile") Topic Author
- [ Offline](/forum/user/11810-basketbox)

Less More

- Posts: 69
- Thank you received: 1
-
-

13 years 9 months ago [\#86425](#86425) by [BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")  Replied by *[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#86425 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Our register global is off. See screenshot. Any other solution?

- [ ![phpsettings.png](/forum/attachment/8079) ](/forum/attachment/8079 "phpsettings.png") [ ](/forum/attachment/8079?download=1 "phpsettings.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 9 months ago [\#86485](#86485) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#86485 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Can you enable the debug mode of Joomla and give us all the error given ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")**
- [![BasketBox's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11810-basketbox "View BasketBox's Profile") Topic Author
- [ Offline](/forum/user/11810-basketbox)

Less More

- Posts: 69
- Thank you received: 1
-
-

13 years 9 months ago -  13 years 9 months ago [\#87137](#87137) by [BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")  Replied by *[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#87137 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Have not tried debug yet, but attached is a screenshot of what I get when I:

Go to a product
Click manage variants
Select variant
Remove code field old data and add new data
Select save and close

Then I get the error attached.

[ ![varienterror&#95;2013-01-25.png](/forum/attachment/8193) ](/forum/attachment/8193 "...2013-01-25.png")

- [ ![varienterror&#95;2013-01-25.png](/forum/attachment/8193) ](/forum/attachment/8193 "...2013-01-25.png") [ ](/forum/attachment/8193?download=1 "...2013-01-25.png")

Last edit: 13 years 9 months ago by [BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

13 years 9 months ago [\#87311](#87311) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#87311 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Hi,

We cannot reproduce the problem.

If you can add the line:
if(is_object($value)) return $value;
before:
$value = is_array($value) ? array_map(array('JRequest', '_stripSlashesRecursive'), $value) : stripslashes($value);
in the file:
/home/basket/public_html/libraries/joomla/environment/request.php
that will remove the error.

It would be great if you could use the line:
if(is_object($value)) var_dump(debug_backtrace());
instead at the same place before the fix and give us the debug trace that you get on the screen when you do that.
That would help us understand what's going on.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")**
- [![BasketBox's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/11810-basketbox "View BasketBox's Profile") Topic Author
- [ Offline](/forum/user/11810-basketbox)

Less More

- Posts: 69
- Thank you received: 1
-
-

13 years 9 months ago [\#87321](#87321) by [BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")  Replied by *[BasketBox](/forum/user/11810-basketbox "View BasketBox's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#87321 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

Let me ask first - can products have the same variant code name? If not, that might be the problem. I'm trying to use the same variant code name for several different products that share the same variant. Also, I noticed that I'm able to save a variant without entering anything in the name field. I thought asterisk field is required?

You can see this at my account. I will send login. Go to Gifts &gt; Mini Box &gt; Roasted California Almonds (Unsalted) - Mini &gt; Manage Variants &gt; Roasted California Almonds (Unsalted) - Mini_5 and change the code to GW2RE then save and error comes. This code was used on the previous product.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

13 years 9 months ago [\#87690](#87690) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Manage Variant Error](/forum/3-bug-report/77611-manage-variant-error#87690 "When I save in manage variant I get this error when I change the code field: Catchable fatal error: Object of class stdClass could not be converted to string in...")*

A variant is stored as a product in the database. And the code has to be unique. So yes, that's probably the issue.

You can indeed have variants without a name as the name is then the concatenation of the main product and the characteristics values.

We've added some checks to avoid that and display an error message instead for next release of HikaShop.
Thank you for your feedback.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC83NzYxMS1tYW5hZ2UtdmFyaWFudC1lcnJvcj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.069 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
