Page 1 of 1

Cannot redeclare class PhocaDownloadLayout

Posted: 02 Feb 2014, 19:46
by docdunning
Just upgraded to PD 3.0.3 on Joomla 3.2.1

I have several menu options set to "List of Files (Category View)". If the PD category has some descriptive text, it is supposed to be displayed at the top of the list of files, but instead I get this:
Fatal error: Cannot redeclare class PhocaDownloadLayout in xxxxx\components\com_phocadownload\helpers\phocadownloadlayout.php on line 13
If I remove the text in the PD category description, then no problem. Add the description back in and the error occurs.

I haven't checked in the code yet, but this looks like it could be a bug ... ?

Re: Cannot redeclare class PhocaDownloadLayout

Posted: 02 Feb 2014, 20:04
by docdunning
Been looking at the code, and the error is caused in \components\com_phocadownload\views\category\tmpl\default.php

The code is as follows:

Code: Select all

			// Description
			/*if ($l->isValueEditor($this->category[0]->description)) {
				echo '<div class="pd-cdesc">'.$this->category[0]->description.'</div>';
			}*/
			
			// Description
			 if ($l->isValueEditor($this->category[0]->description)) {
				echo '<div class="pd-cdesc">';
				echo JHTML::_('content.prepare', $this->category[0]->description);
				echo '</div>';
			 }
I've reversed the comments on these two blocks, so that it uses the first one instead of the second, and now it works without trying to redeclare PhocaDownloadLayout.

Any idea what the problem is, though?

Re: Cannot redeclare class PhocaDownloadLayout

Posted: 05 Feb 2014, 02:05
by Jan
Hi, hmm, I don't understand? Both codes are the some regarding the redeclaring the class. No one of both sets the class :idea:

Jan

Re: Cannot redeclare class PhocaDownloadLayout

Posted: 06 Feb 2014, 22:11
by docdunning
Hi Jan - OK, I'll do some more testing. It does seem odd, as you say ...

Re: Cannot redeclare class PhocaDownloadLayout

Posted: 06 Feb 2014, 23:36
by docdunning
OK, I've solved this one. I was still using the old J2.5 version of the PhocaDownload Plugin. I've now installed the correct plugin for J3.0, and I don't get the error.

Re: Cannot redeclare class PhocaDownloadLayout

Posted: 08 Feb 2014, 02:02
by Jan
Ok