Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check GET values are set before using #16

Closed
kevinb456 opened this issue Feb 27, 2014 · 7 comments
Closed

Check GET values are set before using #16

kevinb456 opened this issue Feb 27, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@kevinb456
Copy link
Contributor

Received message from user;

Great extension but I'm getting the following error on my homepage: Notice: Undefined index: route in /home/wwwridem/public_html/catalog/model/tool/piwik.php on line 218 

The GET variable 'route' is used before checking it is set. This only causes a PHP 'notice' so shouldnt affect operation, however would be good coding practice to solve. Also noticed in my logs other places where this is happening, so look at the other places where this may be happening aswell.

@kevinb456 kevinb456 added this to the Future release milestone Feb 27, 2014
@kevinb456 kevinb456 self-assigned this Feb 27, 2014
@kevinb456 kevinb456 added bug and removed enhancement labels Feb 27, 2014
@kevinb456
Copy link
Contributor Author

Second user reported within a few hours of first, and saying that it stops homepage loading - think opencart may produce an error on loading for PHP 'notices' by default. Can turn off by changing the lines in the php.ini file;

;display_errors = 1;
;error_reporting = E_ALL; 

However not a good fix - better to remove the cause.

@kevinb456
Copy link
Contributor Author

Another user has reported.

Previous comment not completely correct as the PHP error handling is overwritten by Opencart. error handling is instead set in the OC admin at system>settings>server>Display Errors: which can be set to 'no'.

Definitely better to fix the root cause though! Priority fix for next release.

@kevinb456
Copy link
Contributor Author

Comment on opencart.com ;

@InaneCoding: this should fix it
edit the file cataolog/model/tool/piwik.php on line 218 and change this

if ($this->request->get['route'] == "product/search") {

to this

if(isset($this->request->get['route']) && $this->request->get['route']=='product/search'){

That should do the trick

@kevinb456
Copy link
Contributor Author

Related to issue #15

@kevinb456
Copy link
Contributor Author

Another user reported a "Error code: ERR_CONTENT_DECODING_FAILED" error which stops the homepage from loading (other pages okay). After looking at users logs, they have the same PHP notice on line 218 and a google search suggests an opencart bug causes this to appear as a decoding error - so this is probably the same issue.

kevinb456 added a commit that referenced this issue Jun 20, 2014
@kevinb456
Copy link
Contributor Author

I will do a new minor release in the next few days including this latest commit which should fix the errors seen.

@kevinb456
Copy link
Contributor Author

Fixed in v1.1 release 31348b2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant