Custom field error - field "0" not secured

  • Posts: 193
  • Thank you received: 76
10 years 6 months ago #179545

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- Error-message(debug-mod must be tuned on) -- : field "0" not secured

There is an error "field "0" not secured" when trying to save custom field with "Display limited to" set to custom field of type with multiple choices.

How to reproduce:
- Create product custom field with field type Checkbox or Multiple Dropdown
- Create second product custom field, save it and then set "Display limited to" to custom field from step 1, set at least 1 value and save it.

Problem is in the file administrator\components\com_hikashop\classes\field.php on line 1019.
For field types Checkbox and Multiple Dropdown $value is indexed array, therefore $id is 0 and call to
hikashop_secureField() with integer argument results in die().

Here is var_dump($fieldOptions) for field type dropdown



and var_dump($fieldOptions, $value) for field type Checkbox.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
10 years 6 months ago #179646

Hi,

Thanks for the report.
For the moment I fixed the value thanks to

$fieldOptions = JRequest::getVar('field_options', array(), '', 'array');
foreach($fieldOptions as $column => $value) {
	if(is_array($value)) {
		foreach($value as $id => $val) {
			if($column != 'parent_value')
				hikashop_secureField($id);
			$fieldOptions[$column][$id] = strip_tags($val);
		}
I'll talk with Nicolas in order to get his opinion.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
10 years 5 months ago #185323

Excuse me Jerome, I have the same problem with custom field. My question is: did you add this code or changed some other part of code?

Tks!

Last edit: 10 years 5 months ago by ila.qs.ad.

Please Log in or Create an account to join the conversation.

  • Posts: 193
  • Thank you received: 76
10 years 5 months ago #185329

What is your version?
Issue I reported was fixed in later release of Hikashop 2.3.4.

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
10 years 5 months ago #185333

Hi,

That's right Korzo, the fix has been added by Nicolas into HikaShop 2.3.4 and is still present in HikaShop 2.3.5

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
9 years 6 months ago #221968

I have found this problem has resurfaced in HikaShop Business 2.6.0 [1511171458] and using Joomla 3.4.5 What kind of fix or workaround can you suggest please.

My site is currently in development and I am trying to build the event registration form and attach the product for the number of days at the conference and I am recieving this error just like its described above in the previous posts.

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
9 years 6 months ago #221972

Hi,

How did you configure your custom fields ?
Could you provide screenshots of their settings ?
Could you give a link to the registration page so that we could reproduce the problem on your website ?

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0
8 years 9 months ago #248580

HikaShop Business 2.6.3 [1608060803]
Joomla! Version Joomla! 3.6.2 Stable

I'm getting the following message when saving custom filed type entry, with multi and or single drop down menus - "field "0" not secured". Is there a fix for this?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 83933
  • Thank you received: 13588
  • MODERATOR
8 years 8 months ago #251291

Hi,

Please update to the latest version and try again.
If you still have the issue please provide some screenshots of the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.109 seconds
Powered by Kunena Forum