File List Bug - Repeating files

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
plotti
Posts: 34
Joined: Thu 7. Oct 2004, 14:40

File List Bug - Repeating files

Post by plotti »

Heres the description:
Having added two file lists one behind the other in the article phpwcms fills up the second filelist with the articles of the first one after the content of the second.
I hope sb. has a solution.

Here is the screenshot of the bug:
Image
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Post by pepe »

Have you put in something into the second list?

I think, then it's OK :!:
rescamilla
Posts: 69
Joined: Sun 25. Jul 2004, 01:53

Post by rescamilla »

This is a bug that I noticed starting happening in 1.2.1 DEV. In previous versions my File Lists worked perfectly.

I can confirm that the bug is still occuring in 1.2.3 DEV.

See my post here:
http://www.phpwcms.de/forum/viewtopic.php?t=6020

I desperatley need a fix for this.

-Ray
olleolleolle
Posts: 24
Joined: Mon 18. Apr 2005, 21:35
Location: Copenhagen, Denmark
Contact:

I fixed that!

Post by olleolleolle »

Hi,

my name is Olle, and I had that problem on my last project. Bug reporter in this post: cut down on the size of the screenshots will you? My side-scrolling capabilities are small.

(I reported that bug. (Edit: not me, someone else had already done that, and Oliver G had already marked the affair as an array not getting unset.) But, when I reported the bug in the Mantis bug reporting system I was unaware of the name "phpWCMS 2" for the 1.2.1 DEV version, so I did not dare report the bug for the latest version. In the RC just before the Version 2 I posted a little bug report. OG confirmed the bug, and typed a quick fix: " array for file list has to be unset". Cool.)

Here is my trail for finding and fixing the bug. A bit verbose, but at the bottom is the fix.

First, I found out that Content type 7 meant the File list content type. (Had a look at the in /include/inc_tmpl/content/cnt7.inc.php.)

Example of where I had the bug. These two lists contain 5 items versus 1 item. They both display as 5 items.

List A
Anvendelse 19.83 KB
Billede 42.04 KB
Koreografi 27.24 KB
Lyd 36.18 KB
Senere udnyttelse 32.63 KB

List B
Overenskomst 161.24 KB
Billede 42.04 KB
Koreografi 27.24 KB
Lyd 36.18 KB
Senere udnyttelse 32.63 KB

(The bold item is the only item in List B, which displays wrong.)

The problem

The output indicates that the second list uses a non-empty list to start with.

My trail



This post said to look at the file /include/inc_front/content.article.inc.php

...which does not exist in the DEV version, so we take a look at "our" element type. You find that in /include/inc_front/content/cnt7.article.inc.php

Sure enough: There's the code to generate the HTML for the file list. (Reflection: The Typo3 idea of "wrapping" content seems a minuscule tad more flexible than this. Still not flexible enough, though. It needs to be in templates you can hack from the backend interface, think Wordpress, to be sexy enough.)

I was able to recreate the problem with the two file lists.

Additional not-that-important-to-me Windows issue: the name of the file does not get printed in the A element, so the links are there, but invisible until you view source.

The bug was introduced at a change, and OG's leaving comments behind helped me:

Fixing it

Look for this at line 34:

Code: Select all

	$fx=0; $fxa=""; 
	if(isset($fxb)) {
		unset($fxb);
	}
And modify it to this:

Code: Select all

	$fx=0; $fxa=""; 
	if(isset($fxb)) {
		unset($fxb);
	}
	# Add these three lines!
	if(isset($fxc)) {
		unset($fxc);
	}
Last edited by olleolleolle on Thu 26. May 2005, 19:04, edited 3 times in total.
Olle Jonsson
olleolleolle
rescamilla
Posts: 69
Joined: Sun 25. Jul 2004, 01:53

Post by rescamilla »

Thanks for the fix!

I applied the changes and it seems that the file lists are now rendering correctly.

The only correction I can make to your post:

In the 1.2.3 DEV release, the file "cnt7.article.inc.php" is located in "/include/inc_front/content" and not in "/include/inc_front" as you had posted.

Apply this fix guys....it works!

Thanks again olleolleolle.

-Ray
cherusker
Posts: 19
Joined: Thu 31. Mar 2005, 12:44

Post by cherusker »

This also works in Dev-1.2.1

THANK YOU, OLLE!!!
plotti
Posts: 34
Joined: Thu 7. Oct 2004, 14:40

Post by plotti »

Yeah olle youre the man, it solved my problem thx very very much.
and ps. in future i'll cut my screenshots ;)
Post Reply