- Posts: 52
- Thank you received: 0
Characteristic Error
-- HikaShop version -- : Business 2.3.1
-- Joomla version -- : 2.5.9
-- PHP version -- : 5.4.16
-- Browser(s) name and version -- : Google Chrom
-- Error-message(debug-mod must be tuned on) -- :
When trying to save the product after adding the characteristic I get the following message: Warning: Invalid argument supplied for foreach() in /home/<sitehome>/public_html/administrator/components/com_hikashop/classes/product.php on line 666.
On the front end I get the following error when opening the product that gave the problem: Warning: Creating default object from empty value in /home/<sitehome>/public_html/administrator/components/com_hikashop/classes/product.php on line 1336.
Could you please assist with this.
Regards
Please Log in or Create an account to join the conversation.
Can you please re-download HikaShop 2.3.1 ?
About the error in the line 666, I don't understand why you got this message regarding the call of the Joomla Array helper which assures that the variable is a good array (so can be used as argument for the foreach).
About the error on line 1336, I don't have the the same code in my local package, there is not object used only a "bracket" so I can't debug if the line you have is different than mine.
If the problem persist, can you please indicate the content of the line which generate you the error ?
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
I downloaded the package again, and manually copied the various files into the relevant directories. The problem persists. Included is the "products.php" file that is referred to in the error.
Please Log in or Create an account to join the conversation.
Any feedback on this yet?
Regards
Please Log in or Create an account to join the conversation.
These are just small warnings, not real errors. You can remove them by just setting the "error reporting" option of the Joomla configuration to "none" (and it is recommended to leave that option like that for live websites, for security reasons).
The warnings will be removed for next version of HikaShop, but you can use HikaShop with them, it's not a problem and as I said, you can hide them if you want.
Please Log in or Create an account to join the conversation.
The option "Display a contact button on the product page" is enabled, and it displays correctly. Yet, when I want to send a message using this button, the captcha is not displayed and when I try to submit the message, I get an error saying that the Captcha was incorrect.
Subsequint to this I enabled the debug mode to see if there were any errors, but now the entire site fails with the following error: 500 - JDatabaseMySQL::query: 1146 - Table 'lesswhkd_jo151.j16_hikashop_variant' doesn't exist SQL=SELECT variant_product_id FROM j16_hikashop_variant WHERE variant_product_id IN (11,426,430,432,434,435,449,451,525,526,528,529,530,531,532,533,534,602,603,604)
Regards
Please Log in or Create an account to join the conversation.
Progress update: I found that the J16_hikashop_variant table was missing for some reason. I recreated it according to the table definitions under the programming section, and everything is now working again.
Regards
Please Log in or Create an account to join the conversation.
Yes, that table should be there, otherwise HikaShop won't work properly.
For the captcha, do you still have the problem ? If the captcha is not displayed but that you get the error, it means that the recaptcha plugin is enabled and configured to display on the contact form, but that the contact form view has been customized with an override and thus the plugin doesn't find the correct HTML on the contact form to add the captcha HTML, but still checks that the captcha was entered before allowing the contact request.
Please Log in or Create an account to join the conversation.
The Captcha is still problematic, but maybe we should move the discussion to another thread since this is regarding the characteristics.
As for the characteristics, it is working now, but whenever I save a product, another complete set of characteristics gets added - see the attached screenshot.
Regards
Please Log in or Create an account to join the conversation.
It's probably related to the fact that the variant table was missing.
Try again with the debug mode of the Joomla configuration turned on. Do you get some error ?
If you try with a new product, do you also have the problem ?
Yes, for the captcha, you should start a new thread. And pleas check the different points I raised about the issue (modification of the view, settings of the plugin).
Please Log in or Create an account to join the conversation.
When I turn Debug mode on I only get warning such as these: Strict Standards: Only variables should be assigned by reference in /home/lesswhkd/public_html/plugins/system/lpd/lpd.php on line 118.
The problem still occurs with a new product.
Regards
Please Log in or Create an account to join the conversation.
Still having trouble with the variants being added every time a product is saved. Any ideas what could be causing this?
Regards
Please Log in or Create an account to join the conversation.
We're not able to reproduce the problem. Please provide a backend access so that we can look at your settings and the issue.
Please Log in or Create an account to join the conversation.
I sent you the details in a PM.
Regards
Please Log in or Create an account to join the conversation.
I got the access. However, I'm not able to access the HikaShop configuration nor the joomla configuration. Could you make it a super admin in order to be able to heck on that ?
Please Log in or Create an account to join the conversation.
I granted you the access as requested.
Regards
Please Log in or Create an account to join the conversation.
I provided you the access as requested. Any feedback on this yet?
Regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please understand that our support team doesn't work on the weekend.
We're humans and answering as fast as we possibly can.
I checked your website backend queries and from what I can see, the problem is that the primary key on the columns variant_characteristic_id and variant_product_id has been removed from the table hikashop_variant in your database.
Because of that, the "replace" query that is done on that table duplicates the entries instead of replacing them when a product data is saved.
So it's not a bug but apparently that table has been tampered with in your database.
The best will be to drop the hikashop_variant table completely from the database via your phpmyadmin and add it back with that query that you can execute via your phpmyadmin too:
Please Log in or Create an account to join the conversation.
Thanks for the reply. I do understand the constraints that there might be, but you need to realise that you are working with an international audience covering various time zones and that the reply on which I did not receive feedback was posted before the weekend (local time).
In any event. I will look at the table and follow your instructions. I will feedback soon.
Regards
Please Log in or Create an account to join the conversation.