Page 1 of 1

Broken modification.php file

Posted: Sat May 30, 2015 12:49 am
by thumperbay
I tried to install an extension today and ended up with a blank white screen where the Admin used to be. I looked at /apache2/errors.log and was able to back out the changes and get the Admin back up.

This is on ver 2.0.2.0

However, the Modifications tab is still broken. I get a blank screen when I try to run it, and the below in the error.log

Code: Select all

[Fri May 29 12:44:26.261638 2015] [:error] [pid 4093] [client 71.46.227.106:34437] PHP Parse error:  syntax error, unexpected 'protected' (T_PROTECTED) in /srv/www/[site]/htdocs/system/modification/admin/controller/extension/modification.php on line 50, referer: http://[site].com/admin/index.php?route=common/dashboard&token=806a4089b47f4ff699d1402608938388
I wonder if I removed something I shouldn't have when I was taking out what the extension did. Does anyone have a clean copy of /system/modification/admin/controller/extension/modification.php they could post so I could compare to mine?

Thanks

ps I replaced the actual domain with [site] in the above output because it is under construction

Re: Broken modification.php file

Posted: Sat May 30, 2015 1:00 am
by thumperbay
Here are the lines around line 50 of my file, maybe someone will be able to just look at it and tell me what's wrong.

Code: Select all

		if (isset($this->request->post['selected']) && $this->validate()) {
			foreach ($this->request->post['selected'] as $modification_id) {
				$this->model_extension_modification->deleteModification($modification_id);
			}

			$this->session->data['success'] = $this->language->get('text_success');

			$url = '';

			if (isset($this->request->get['sort'])) {
				$url .= '&sort=' . $this->request->get['sort'];
			}

			if (isset($this->request->get['order'])) {
				$url .= '&order=' . $this->request->get['order'];
			}

			if (isset($this->request->get['page'])) {
				$url .= '&page=' . $this->request->get['page'];
			}


	protected function vqmodGetIndexes( $search_node_index ) {
		if ($search_node_index) {
			$tmp = explode(',', $search_node_index);
			foreach ($tmp as $k => $v) {
				if (!is_int($v)) {
					unset($k);
				}
			}
			$tmp = array_unique($tmp);
			return empty($tmp) ? false : $tmp;
		} else {
			return false;
		}
	}

	protected function vqmodGetFileKey( $file ) {
		// Get the key to be used for the modification cache filename.
		$key = '';
		if (substr($file, 0, strlen(DIR_CATALOG)) == DIR_CATALOG) {
			$key = 'catalog/' . substr($file, strlen(DIR_CATALOG));
		}
		if (substr($file, 0, strlen(DIR_APPLICATION)) == DIR_APPLICATION) {
			$key = 'admin/' . substr($file, strlen(DIR_APPLICATION));
		}
		if (substr($file, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) {
			$key = 'system/' . substr($file, strlen(DIR_SYSTEM));
		}
		return $key;
	}

	protected function vqmodWrite( DOMDocument $dom, &$modification, &$original, &$log ) {
		$modification_node = $dom->getElementsByTagName('modification')->item(0);
		$file_nodes = $modification_node->getElementsByTagName('file');
		$modification_id = $modification_node->getElementsByTagName('id')->item(0)->nodeValue;

		$log[] = "Modification::refresh - Processing '". $modification_id ."'";

		$version = '2.5.1';
		$vqmver = $modification_node->getElementsByTagName('vqmver')->item(0);
		if ($vqmver) {
			$version_check = $vqmver->getAttribute('required');
			if (strtolower($version_check) == 'true') {
				if (version_compare($version, $vqmver->nodeValue, '<')) {
					$log[] = "Modification::refresh - VQMOD VERSION '" . $vqmver->nodeValue . "' OR ABOVE REQUIRED, XML FILE HAS BEEN SKIPPED";
					$log[] = "  vqmver = '$vqmver'";
					$log[] = '----------------------------------------------------------------';
					return;
				}
			}
		}

Re: Broken modification.php file

Posted: Sat May 30, 2015 2:19 am
by rph
You've installed some custom mod which mucked things up. Reupload the original file.

Re: Broken modification.php file

Posted: Sat May 30, 2015 2:37 am
by thumperbay
rph wrote:You've installed some custom mod which mucked things up. Reupload the original file.
Yea, that's why I was here asking for help. I don't have the original file.

Re: Broken modification.php file

Posted: Sun May 31, 2015 1:02 am
by rph

Re: Broken modification.php file

Posted: Thu Jun 04, 2015 11:28 pm
by thumperbay
Thank you rph, I ended up re-installing to fix it. The file I needed is not in the download btw, it must only be created on install.