Post by veritas75 » Fri Jun 10, 2016 5:19 pm

Hi Guys,

I am getting the following error.

PHP Notice: Undefined index: key in xxx/catalog/controller/api/login.php on line 11

I am using OC 2.2.0.0

I noticed this error when i logged in and went to update an order and started getting Undefined Error when logging into the order page.

Travis

Newbie

Posts

Joined
Sat May 21, 2016 3:27 pm

Post by i2Paq » Fri Jun 10, 2016 6:02 pm

Admin of Storefront?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by veritas75 » Fri Jun 10, 2016 9:03 pm

What do you mean the admin of the storefront??

Newbie

Posts

Joined
Sat May 21, 2016 3:27 pm

Post by straightlight » Fri Jun 10, 2016 9:21 pm

Are you trying to authenticate on an order from an installed extension? It seems like the authentication process fails from a specific admin page.

Admin page: Back-end interface of Opencart for administrative purposes.
Store-front end: For customers to visit your shop.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by veritas75 » Sat Jun 11, 2016 11:52 am

I am not sure how that would effect what is happening.

All I am doing is going into orders, going to view an order and getting a pop up that states undefined error.

I check the error log and that is what I see??

Newbie

Posts

Joined
Sat May 21, 2016 3:27 pm

Post by straightlight » Sat Jun 11, 2016 8:00 pm

veritas75 wrote:I am not sure how that would effect what is happening.

All I am doing is going into orders, going to view an order and getting a pop up that states undefined error.

I check the error log and that is what I see??
It would definitely affect if the defined key has not been properly defined from the installed contribution. Even though you might simply do it from the order page, it does not prevent the installed contribution to authenticate to the API. More information would be needed on that end regarding installed contributions you might be using for the orders or if you do not use any contributions for the orders.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jhebb » Fri Aug 05, 2016 10:22 pm

Looks like if you have set the site up on full SSL then there is an issue in the /admin/controller/sale/order.php. If you look in the console I was seeing this error.

jquery-2.1.1.min.js:4 XMLHttpRequest cannot load httpss://www.site.com/index.php?route=api/login. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

If you notice there is an extra 's' in the https request.

In the order php file, you will find this line.

Code: Select all

$data['store_url'] = $this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];
Look like the string replace is taking the http out and replacing it with https. Problem is that is already https in the line, so it's taking out http from the https and making it httpss. I just made the line this.

Code: Select all

$data['store_url'] = $this->request->server['HTTPS'] ? str_replace("https", "https", $order_info['store_url']) : $order_info['store_url'];
Now it's taking out the https and replacing it with https and the URL is correct and the error when looking at orders is gone.
Last edited by straightlight on Sat Aug 06, 2016 3:28 am, edited 1 time in total.
Reason: Added code tags.

New member

Posts

Joined
Tue Oct 18, 2011 7:32 am

Post by mobilewill » Thu Sep 15, 2016 1:07 pm

Thanks for this information to get this fixed. This happened to me with my force SSL for the entire site. I added this fix to my SSL VQMod which I have published if anyone needs it.

VQMod Enable SSL with fix

Current VQMods: http://www.opencart.com/index.php?route ... mobilewill
Blog: http://www.mobilewill.us
Shop: http://friedcircuits.us


Newbie

Posts

Joined
Tue Oct 01, 2013 10:15 am

Post by ndim_pro » Thu Oct 27, 2022 3:13 pm

Just to let everyone know. In my case, I tried everything but nothing worked and finally after looking more carefully, I noticed that in config.php file I had one more dot in the url. That was causing all trouble. So, check again thoroughly your settings in both config.php files.

User avatar
New member

Posts

Joined
Fri Nov 04, 2016 4:49 pm
Location - Thessaloniki, Greece

Post by straightlight » Thu Oct 27, 2022 11:14 pm

ndim_pro wrote:
Thu Oct 27, 2022 3:13 pm
Just to let everyone know. In my case, I tried everything but nothing worked and finally after looking more carefully, I noticed that in config.php file I had one more dot in the url. That was causing all trouble. So, check again thoroughly your settings in both config.php files.
I was able to reproduce this problem with dots on the URL with opencart-3 (not officially updated with these changes). It also messes up the database for some reason. This was already reported on Github Opencart recently but, due to the fact that web hosting services have a hard time accepting forward slashes to reach the methods as well as the: '|' character, the dot took the place but isn't going any better on that side unfortunately.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Semrush [Bot] and 77 guests