Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ошибка


tchibo
 Share

Recommended Posts

При перехогде во вкладку "Усиновка дополнений" выдает ошибку Fatal error: Cannot redeclare ControllerExtensionInstaller::localcopy() in  /public_html/system/storage/modification/admin/controller/extension/installer.php on line 281
Что гделать, подскажите пожалуйси!!!

Link to comment
Share on other sites


  • 1 year later...
  • 2 months later...
В 16.05.2019 в 21:54, IluaTsvetkov2019 сказал:

а что удалили то? икая же проблема

Если прям внатуре икая же, то скорее всего тебе надо задвоение в когде по этому пути найти, гляди localcopy

 

Их им 2 должно быть, если опрегделится 3, то удали последнюю!)

 

Спойлер
public function localcopy() {
		$this->load->language('extension/installer');

		$json = array();

		if (!$this->user->hasPermission('modify', 'extension/installer')) {
			$json['error'] = $this->language->get('error_permission');
		}

		if (VERSION == '2.0.0.0') {
		    $directory = DIR_DOWNLOAD  . str_replace(array('../', '..\\', '..'), '', $this->request->post['path']) . '/upload/';
		} else {
		    $directory = DIR_UPLOAD  . str_replace(array('../', '..\\', '..'), '', $this->request->post['path']) . '/upload/';
		}

		if (!is_dir($directory)) {
			$json['error'] = $this->language->get('error_directory');
		}

		if (!$json) {
			// Get a list of files ready to upload
			$files = array();

			$path = array($directory . '*');

			while (count($path) != 0) {
				$next = array_shift($path);

				foreach (glob($next) as $file) {
					if (is_dir($file)) {
						$path[] = $file . '/*';
					}

					$files[] = $file;
				}
			}

			$root = dirname(DIR_APPLICATION).'/';

			foreach ($files as $file) {
				// Upload everything in the upload directory
				$destination = substr($file, strlen($directory));

				// Update from newer OpenCart versions:
				if (substr($destination, 0, 5) == 'admin') {
					$destination = DIR_APPLICATION . substr($destination, 5);
				} else if (substr($destination, 0, 7) == 'catalog') {
					$destination = DIR_CATALOG . substr($destination, 7);
				} else if (substr($destination, 0, 5) == 'image') {
					$destination = DIR_IMAGE . substr($destination, 5);
				} else if (substr($destination, 0, 6) == 'system') {
					$destination = DIR_SYSTEM . substr($destination, 6);
				} else {
					$destination = $root.$destination;
				}

				if (is_dir($file)) {
					if (!file_exists($destination)) {
						if (!mkdir($destination)) {
							$json['error'] = sprintf($this->language->get('error_ftp_directory'), $destination);
						}
					}
				}

				if (is_file($file)) {
					if (!copy($file, $destination)) {
						$json['error'] = sprintf($this->language->get('error_ftp_file'), $file);
					}
				}
			}
		}

		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}

 

 

Скорее всего этот кусочек кода не дает тебе запустится!

 

Попробуй его удалить и бугдет чудо!)

  • +1 1
Link to comment
Share on other sites


  • 4 months later...
Спойлер
В 29.07.2019 в 13:34, MFX сказал:

Если прям внатуре икая же, то скорее всего тебе надо задвоение в когде по этому пути найти, гляди localcopy

 

Их им 2 должно быть, если опрегделится 3, то удали последнюю!)

 

  Скрыть контент


public function localcopy() {
		$this->load->language('extension/installer');

		$json = array();

		if (!$this->user->hasPermission('modify', 'extension/installer')) {
			$json['error'] = $this->language->get('error_permission');
		}

		if (VERSION == '2.0.0.0') {
		    $directory = DIR_DOWNLOAD  . str_replace(array('../', '..\\', '..'), '', $this->request->post['path']) . '/upload/';
		} else {
		    $directory = DIR_UPLOAD  . str_replace(array('../', '..\\', '..'), '', $this->request->post['path']) . '/upload/';
		}

		if (!is_dir($directory)) {
			$json['error'] = $this->language->get('error_directory');
		}

		if (!$json) {
			// Get a list of files ready to upload
			$files = array();

			$path = array($directory . '*');

			while (count($path) != 0) {
				$next = array_shift($path);

				foreach (glob($next) as $file) {
					if (is_dir($file)) {
						$path[] = $file . '/*';
					}

					$files[] = $file;
				}
			}

			$root = dirname(DIR_APPLICATION).'/';

			foreach ($files as $file) {
				// Upload everything in the upload directory
				$destination = substr($file, strlen($directory));

				// Update from newer OpenCart versions:
				if (substr($destination, 0, 5) == 'admin') {
					$destination = DIR_APPLICATION . substr($destination, 5);
				} else if (substr($destination, 0, 7) == 'catalog') {
					$destination = DIR_CATALOG . substr($destination, 7);
				} else if (substr($destination, 0, 5) == 'image') {
					$destination = DIR_IMAGE . substr($destination, 5);
				} else if (substr($destination, 0, 6) == 'system') {
					$destination = DIR_SYSTEM . substr($destination, 6);
				} else {
					$destination = $root.$destination;
				}

				if (is_dir($file)) {
					if (!file_exists($destination)) {
						if (!mkdir($destination)) {
							$json['error'] = sprintf($this->language->get('error_ftp_directory'), $destination);
						}
					}
				}

				if (is_file($file)) {
					if (!copy($file, $destination)) {
						$json['error'] = sprintf($this->language->get('error_ftp_file'), $file);
					}
				}
			}
		}

		$this->response->addHeader('Content-Type: application/json');
		$this->response->setOutput(json_encode($json));
	}

 

 

Скорее всего этот кусочек кода не дает тебе запустится!

 

Попробуй его удалить и бугдет чудо!)

Спасипотому что помогло решение!)))

 

А то думал ггде вновь искать, память то не вечная!)

 

Спасипотому что, что ты есть!)

Link to comment
Share on other sites


  • 8 months later...
  • 2 weeks later...
В 05.08.2020 в 14:46, Amishkin сказал:

ребят а если тут проблема? то что гделать? подскажите пожалуйси! /extension/installer.php on line 294\n

какой то модуль ocmod или vqmod дублирует функции, нужно убрать дублирование, если они одинаковые, а если функционал у функций разный, то нужно переименовать

Link to comment
Share on other sites


  • 1 year later...

Здравствуйте!

Подскажите и мне пожалуйси

Fatal error: Cannot redeclare ControllerMarketplaceModification::edit() in /home/eua/storage/modification/admin/controller/marketplace/modification.php on line 1449

 

Ошибка появляется при попытке зайти в модификаторы.

Edited by yurok79
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.