Post by straightlight » Mon Nov 27, 2017 2:58 am

Responding to this bug report: https://github.com/opencart/opencart/is ... -container

In install/model/upgrade/1000.php file,

find:

Code: Select all

foreach ($query->rows as $result) {
                   $this->db->query("ALTER TABLE `" . DB_PREFIX . $table['name'] . "` DROP INDEX IF EXISTS `" . $result['Key_name'] . "`");				}
replace with:

Code: Select all

foreach ($query->rows as $result) {
                    if (!empty($result['Key_name'])) {
						$this->db->query("ALTER TABLE `" . DB_PREFIX . $table['name'] . "` DROP INDEX IF EXISTS `" . $result['Key_name'] . "`");
					}
				}
				
since the Key_name index from the array is not guaranteed to have, based on the entire loop. This should rectify the issue.

The most generated errors being found on Opencart forum originates from contributed programming.

Regards,
Straightlight


Guru Member

Posts

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

Users browsing this forum: No registered users and 2 guests