AJAX HTTP error occurred. Code HTTP: 403 when adding new product in product reference

kpatsali's picture
kpatsali
Tue, 05/17/2016 - 12:23
#1
AJAX HTTP error occurred. Code HTTP: 403 when adding new product in product reference

Hello,

When I try to add new product, node/add/product, under Product Ref, I am getting this error:

AJAX HTTP error occurred.
Code HTTP: 403
Debugging Information.
Path: /el/system/ajax
Status text: Forbidden
ResponseText:

AJAX HTTP error occured.
Code HTTP: 403
Debugging Information.
Path: /el/media/ajax/field_product_ref/und/form/field_product_gallery/und/form-SLydrfRL6ZAoo9YIda8AoBUukD42w5npiKILVL2e544
Status Text: Forbidden
ResponseText: [{"command":"settings","settings":{"basePath":"\/","pathPrefix":"el\/","ajaxPageState":{"theme":"md_orenmode","theme_token":"nnqCn9WsZA_EIeLvc-XZMHPizXVQPFN0rn2tUoDah-E"}},"merge":true},{"command":"insert","method":"replaceWith","selector":null,"data":"\u003Cdiv class=\u0022alert alert-danger\u0022 role=\u0022alert\u0022\u003E\u003Cbutton type=\u0022button\u0022 class=\u0022close\u0022 data-dismiss=\u0022alert\u0022\u003E\u003Cspan aria-hidden=\u0022true\u0022\u003E\u0026times;\u003C\/span\u003E\u003Cspan class=\u0022sr-only\u0022\u003EClose\u003C\/span\u003E\u003C\/button\u003E\u03a0\u03c1\u03bf\u03ad\u03ba\u03c5\u03c8\u03b5 \u03ad\u03bd\u03b1 \u03b1\u03bd\u03b5\u03c0\u03b1\u03bd\u03cc\u03c1\u03b8\u03c9\u03c4\u03bf \u03c3\u03c6\u03ac\u03bb\u03bc\u03b1.\u03a4\u03bf \u03b1\u03c0\u03b5\u03c3\u03c4\u03b1\u03bb\u03bc\u03ad\u03bd\u03bf \u03b1\u03c1\u03c7\u03b5\u03af\u03bf \u03c6\u03b1\u03af\u03bd\u03b5\u03c4\u03b1\u03b9 \u03cc\u03c4\u03b9 \u03c5\u03c0\u03b5\u03c1\u03b2\u03b1\u03af\u03bd\u03b5\u03b9 \u03c4\u03bf \u03bc\u03ad\u03b3\u03b9\u03c3\u03c4\u03bf \u03bc\u03ad\u03b3\u03b5\u03b8\u03bf\u03c2 \u03b1\u03c1\u03c7\u03b5\u03af\u03bf\u03c5 (2 MB) \u03c0\u03bf\u03c5 \u03c5\u03c0\u03bf\u03c3\u03c4\u03b7\u03c1\u03af\u03b6\u03b5\u03b9 \u03b1\u03c5\u03c4\u03cc\u03c2 \u03bf \u03b4\u03b9\u03b1\u03ba\u03bf\u03bc\u03b9\u03c3\u03c4\u03ae\u03c2.\u003C\/div\u003E\n","settings":null}]

The problem occurred after installing Metatag module...

At first the problem was solved after I increased the memory limit on my server (I am using php 5.5).

I updated drupal core to 7.43 few weeks ago and everything were fine, but suddenly the same problem appeared...

Is this anything got to do with the theme? I have used Metatag before and I didn't have these problems...

Shall I update commerce module and jquery? Would that be a problem with my site?

I have opened an issue in Metatag module: https://www.drupal.org/node/2727547

So far, if I want to add new product, I disable Metatag, add new product and then enable the module again...

Any help would be appreciated.

Thank you in advance.

khoa's picture
khoa
Tue, 05/17/2016 - 20:37

Hello,

Please give me your Website account. And remember to make a backup of your site before sending it.

Thanks!

khoa's picture
khoa
Wed, 05/18/2016 - 21:23

Hello,

I created a product demo page. However, I didn't see the error as you got. You can see this video that I recorded from my computer.

Link: https://www.dropbox.com/s/lhl49vdirjc7rqu/demo.flv?dl=0

Thanks!

kpatsali's picture
kpatsali
Thu, 05/19/2016 - 02:21

Hello Khoa,

indeed! But you added only one product XL under product reference... if you try to add more then three you will face the problem... Let's say in example you want a product with sizes of XS, S, M, L, XL, XXL and in every size you correspond an image... start adding size XS, then size S and then size M... after the 3rd or 4th product the problem appears... You will not be able to add all six sizes at once... Please try again... Thank you!

khoa's picture
khoa
Thu, 05/19/2016 - 03:28

Hello,

I have changed the jquery version. Please try again and let me know the result.

Thanks!

kpatsali's picture
kpatsali
Thu, 05/19/2016 - 03:53

Hello,

no, it didn't change the situation... same problem after 3rd product...

I also did that at the past...

Thank you!

khoa's picture
khoa
Thu, 05/19/2016 - 04:38

Hello,

Do you have a backup before upgrading to Drupal 7.43? If you have you can check whether that old version has the error as you mention.

Thank you!

kpatsali's picture
kpatsali
Thu, 05/19/2016 - 11:48

Hello,

I have updated Drupal core three times!

in the older versions I had the same problem, before and after updating, which was solved after increasing the memory limit on my server. After upgrading to Drupal 7.43, I didn't have this problem at first... it appeared suddenly after two or three weeks whithout any changes from me... I don't know if this got to do with the update... This problem occurred from the first time I enabled the Metatag module... from the first week my site was live... with the one or the other way I made things working... that's why I am asking you if there is a theme problem, because it appears to be a problem with field product ref as you can see from the appeared message:

Path: /el/media/ajax/field_product_ref/und/form/field_product_gallery/und/form-SLydrfRL6ZAoo9YIda8AoBUukD42w5npiKILVL2e544

I have used Metatag to other Commerce sites, but I never faced this problem again...

I am thinking of updating commerce module and jquery, but I don't know if this will drive me to other problems with the site...

Any suggestions would be appresiated...

Thank you!

khoa's picture
khoa
Thu, 05/19/2016 - 20:44

Hello,

Can you please send me your website source code + database to [email protected]. I'll install it on my host and test it.

Thank you!

khoa's picture
khoa
Sat, 05/21/2016 - 11:17

Hello Kpatsali,

I have found a solution to fix your error. Please see this post: https://www.drupal.org/node/2406135. I did what that post suggested and it worked well on my local server.

Thanks!

kpatsali's picture
kpatsali
Mon, 05/23/2016 - 04:53

Hello Khoa,

I reverted back to PHP 5.3 and the site couldn't be loadded at all... So I turned it back to PHP 5.5. My upload_max_filesize in PHP is 256 MB, but still I am getting the same error.... It is propably a server problem... I will comunicate with my hoster...

Thank you!

khoa's picture
khoa
Mon, 05/23/2016 - 05:14

Hello Kpatsali,

You need to enable this value: max_input_vars in php.ini file.

Thanks!

kpatsali's picture
kpatsali
Mon, 05/23/2016 - 06:02

Hello Khoa,

Sorry for I didn't mention It 's enabled ant its value is 1000, but I cannot increase this value on cPanel PHP Configuration or find php.ini at the location Drupal status report indicates me or in my root folder. I 'll try .htaccess and communicate with server administrator.

Thank you very much!

kpatsali's picture
kpatsali
Mon, 05/23/2016 - 08:49

Hello Khoa,

max_input_vars=10000. Still the same problem...

Thank you!

kpatsali's picture
kpatsali
Mon, 05/23/2016 - 13:24

Hello Khoa,

I solved the problem by disabling ModSecurity filters for my domain on my server!

Thank you!

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.