Post by snowbird » Thu Apr 26, 2018 11:25 pm

opencart version 2.3.0.2

After switching PHP version from PHP 5.6 to PHP 7.1 i get following error in the ERROR logfile of the hosting server:
[php7:notice] [host www.MYDOMAIN.com] PHP Notice: Undefined index: language in system/storage/modification/catalog/controller/startup/startup.php on line 39

The opencart shop seems to work without errors so far and no errors are being written into the error log of opencart.

Any idea how I can adjust startup.php in order to get rid of this PHP7 error in the log of the web hoster?

Thank you!
David

Newbie

Posts

Joined
Thu Sep 21, 2017 11:06 pm

Post by thekrotek » Fri Apr 27, 2018 12:22 am

Set Display Errors to No in your store settings.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by snowbird » Sun Apr 29, 2018 8:30 pm

I changed Display Errors to No under Error Handling in opencart>Settings>Store>Server, but the error in the server log of my webhoster is still being logged.

Newbie

Posts

Joined
Thu Sep 21, 2017 11:06 pm

Post by thekrotek » Sun Apr 29, 2018 9:45 pm

Ignore it.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by IP_CAM » Mon Apr 30, 2018 6:27 am

Well, it might not be the upmost professional way of doing things, to just ignore Server
Warnings, or even Error messages, but just today, I stumbled over an extension, making
life a little easier for those, unable to get rid of such Messages. After an error file contains
more than 1MegaByte of such lines, one gets informed, to do something about it, by either
deleting it's content, or better, start to fix the system... :D
But you could also check, if your Hoster uses PHP v.7.0.xx as well, and try with that Version,
since v.7.0.xx even functions with v.1.5.6.x ...
Good Luck! ;)
Ernie
----
error_log_check_and_alert.xml VqMod File:

Code: Select all

<modification>
<id>Error log check and alert</id>
<version>1.0.0</version>
<vqmver>2.x</vqmver>
<author>Radi Penchev- radidesign.net</author>
<file name="/admin/view/template/common/header.tpl">
<operation error="log">
<search position="bottom"><![CDATA[]]></search>
<add><![CDATA[
	<style type="text/css">
	#content {
	padding-top: 20px!important;
	}
	.warning {
	position: absolute!important;
	margin-top: 4px;
	margin-left: 30px;
	}
	</style>
<?php
	$filename = $file = DIR_LOGS . $this->config->get('config_error_filename');
	if (filesize($filename) > 1000000) {
	echo '<div class="warning" >';
	echo $filename . ': ' . filesize($filename) ;
	echo ' bytes';
	echo '<a href="';
	echo $this->data['clear'] = $this->url->link('tool/error_log/clear', 'token=' . $this->session->data['token'], 'SSL');
	echo '" > CLEAR</a>';
	echo '</div>';
	} else {
	}
?>
]]></add>
</operation>
</file>
</modification>
----
# error log check OpenCart
Simple module which checks the error file (error.txt) when its size exceeds 1MB and notify you.
View vqmod file :
https://github.com/rpenchev/error_log_c ... _alert.xml
or add thist code in /admin/view/template/common/header.tpl after all code

Code: Select all

<style type="text/css">
	#content {
	padding-top: 20px!important;
	}
	.warning {
	position: absolute!important;
	margin-top: 4px;
	margin-left: 30px;
	}
</style>
<?php
$filename = $file = DIR_LOGS . $this->config->get('config_error_filename');	
if (filesize($filename) > 1000000) {
	echo '<div class="warning" >';
	echo $filename . ': ' . filesize($filename) ;
	echo ' bytes';
	echo '<a href="';
	echo $this->data['clear'] = $this->url->link('tool/error_log/clear', 'token=' . $this->session->data['token'], 'SSL');
	echo '" > CLEAR</a>';
	echo '</div>';
} else {
}
?> 

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by uksitebuilder » Mon Apr 30, 2018 3:38 pm

As the error is in the modification path, it seems an extension has overridden the default OC code.

Please check what modifications you have installed in your admin - Extension - Modifications section that may relate to languages.

Temporarily disable any such modifications one by one and test until the error ceases being logged.

Don't forget to refresh modifications after disabling so the files get re-written.

Once you know which one it is, contact the developer of the extension for support.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by snowbird » Mon May 07, 2018 9:29 pm

Thank you Simon, you were right. The error was due to a modification for shared ssl which used $this->session->data['language'] before the language was set in the language section of startup.php. I had just to put the set url function after the language detection and everything works now without errors in PHP 7.

Newbie

Posts

Joined
Thu Sep 21, 2017 11:06 pm
Who is online

Users browsing this forum: No registered users and 421 guests