bagisto / bagisto

Free and open source laravel eCommerce platform
https://bagisto.com
Open Software License 3.0
14.52k stars 2.15k forks source link

Replace $_SERVER['REQUEST_URI'] with Larvel's request object #1251

Closed tushargugnani closed 4 years ago

tushargugnani commented 5 years ago

I installed bagisto and tried to run the tests. Looks like you can't run the feature test without spinning up the server, since there are instances of $_SERVER['REQUEST_URI'] in many files. I suggest it to replace with $request->getRequestUri().

I replaced this in the following files and was able to run the test without spinning up the server.

packages/Webkul/Admin/src/Exceptions/Handler.php packages/Webkul/Shop/src/Http/Middleware/Currency.php packages/Webkul/Shop/src/Http/Middleware/Locale.php Shop -> footer.blade.php Shop -> header.blade.php

rahulshukla-webkul commented 5 years ago

Hi @tushargugnani

Thanks for raising this one, we will change.

ghermans commented 5 years ago

@tushargugnani i have send a PR to fix this , but i couldn't find any $_SERVER['REQUEST_URI'] instance in the following files

packages/Webkul/Shop/src/Http/Middleware/Currency.php packages/Webkul/Shop/src/Http/Middleware/Locale.php

tushargugnani commented 5 years ago

@ghermans It's there in the version that I have on my local, check this.

https://github.com/bagisto/bagisto/blob/v0.1.7-BETA2/packages/Webkul/Shop/src/Http/Middleware/Currency.php

ghermans commented 5 years ago

oh, hmm It looks like this has already been fixed in the master branch

https://github.com/bagisto/bagisto/blob/master/packages/Webkul/Shop/src/Http/Middleware/Currency.php#L30

prashant-webkul commented 5 years ago

@ghermans @tushargugnani https://github.com/bagisto/bagisto/commit/c7add7e2fed133730f951fe3b7c49ab734259531#diff-3f53d1504bb570b2984faca035f5bbff

tushargugnani commented 5 years ago

@prashant-webkul Off topic. How can I use the latest (master) code of bagisto instead of v0.1.0 on my local?

prashant-webkul commented 5 years ago

@prashant-webkul Off topic. How can I use the latest (master) code of bagisto instead of v0.1.0 on my local?

Can't you update to latest version, v0.1.0? So many new features and security fixes have been done since then.

tushargugnani commented 5 years ago

@prashant-webkul I am on version v.0.1.0 , was looking if I can ahead to the master branch.