Foren / Cotonti / Bugs / Archive / possible bug report

pfs hook::pfs.upload.moved

ez
#1 12. April 2010, 03:17
Hi there,

I have made a plugin called "Image upload downsizer".

What happes is this:

When you upload two large images, the first one gets downsized, but the second one doesn't.
I traced this mistake back to pfs.inc.php...

I think the hook is not called properly !!

							/* === Hook === */
							$extp = sed_getextplugins('pfs.upload.moved');
							if (is_array($extp))
							{ foreach($extp as $k => $pl) { include_once ($cfg['plugins_dir'].'/'.$pl['pl_code'].'/'.$pl['pl_file'].'.php'); } }
							/* ===== */

The reason why I say this is that i have made the following statement in my plugin code :

$disp_errors.="Start :: ";

And only in the results off the FIRST uploaded file this text is shown, all other files this text is missing... :(

So That's why I think this hook is not good ????? (or the code only gets executed on the first file)

I am Using version 0.65
==- I say: Keep it EZ -==
Trustmaster
#2 12. April 2010, 14:09
The problem is include_once. It must be changed for just include in loops.
May the Source be with you!
ez
#3 12. April 2010, 15:24
aaahhh now I understand what was happening... thnx Trustmaster. (So there was a bug in there.. )

OOPS are there more loops like this in Cotonti, then they all should change..

greetings EZ
==- I say: Keep it EZ -==
Trustmaster
#4 12. April 2010, 18:56
In many places such as forum posts loop we have taken it into account, but in some not so popular hooks like those pfs hooks we simply missed them. If 0.6.8 comes (i.e. there are more critical bugs to fix), it will be included there. Siena uses a bit different hook format with include() by default.
May the Source be with you!