Member
Member
bic   2009-05-29, 09:20
#1

If a normal user tryes to download a zip archive of an album he gets this error:
Fatal error: Class 'album' not found in ***/zp-core/functions.php on line 550

Zenphoto version 1.2.5_RC1 [3982]

Everything works fine for admins with edit rights on the album.

Member
Member
sbillard   2009-05-29, 15:28
#2

I am not able to reproduce this error. Could you please provide a link to your site for testing?

Member
Member
bic   2009-05-29, 16:04
#3

Ok, I hope nobody else will see it now, I'm still in a testing stage.

http://www.antonioranesi.it/temp/

The only real album is Test, Portfolio is a dynamic album

Administrator
Administrator
acrylian   2009-05-29, 16:41
#4

Indeed, I can reproduce that I get this error if not logged in. We will try to solve that.

Member
Member
sbillard   2009-05-29, 19:27
#5

Ok, found the problem. I could not reproduce it because another change I was working on accidentally fixed it! Fix will be in the nightly build tonight.

Member
Member
bic   2009-05-29, 19:45
#6

Yes, updated album-zip.php from SVN and it works now. Thanks!
I was trying to require class-load.php in functions.php, shame on me!

Member
Member
sbillard   2009-05-29, 23:53
#7

Not shame on you. That is actually the way I accidentally fixed it in my developement source. But unfortunately, there was more to that change than that one line, so it has to wait for the 1.2.5 development stream.

Member
Member
bic   2009-06-03, 09:34
#8

Still problems with PrintAlbumZip.
If I use that function for an album with subalbums I get a lot of warnings and no output.

If the album is in the roor folder (albums) then the zip file is created but displayed as plain text in browser, after this warnings:

`
Notice: Undefined variable:
zip in /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 31

Notice: Undefined variable:
zip in /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 31

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:31) in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 80

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:31) in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 81

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:31)
in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 82
`
If the album is inside another album then the zip file is not created at all and I get this warnings:

`
Warning: chdir() [function.chdir]: No such file or directory (errno 2)
in /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 25

Warning: opendir(/home/web/www.antonioranesi.it/www/temp/albums/Diocesi_Civitavecchia/S.Agostino_Civitavecchia/Diocesi_Civitavecchia3133OT03/)
[function.opendir]: failed to open dir: No such file or directory in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 26

Warning: chdir() [function.chdir]: No such file or directory (errno 2)
in /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 25

Warning: opendir(/home/web/www.antonioranesi.it/www/temp/albums/Diocesi_Civitavecchia/S.Agostino_Civitavecchia/Diocesi_Civitavecchia3133OT01/)
[function.opendir]: failed to open dir: No such file or directory in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 26

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:25) in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 80

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:25) in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 81

Warning: Cannot modify header information - headers already sent by
(output started at /home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php:25) in
/home/web/www.antonioranesi.it/www/temp/zp-core/album-zip.php on line 82
PK
`
Actually in the second case the directories are wrong. They sould be like:

Diocesi_Civitavecchia/S.Agostino_Civitavecchia/3133OT01/

not
Diocesi_Civitavecchia/S.Agostino_Civitavecchia/Diocesi_Civitavecchia3133OT01/

edit:
If I add $zip to global in
function zipAddSubalbum($base, $offset, $subalbum)
The first case works as expected!!

Member
Member
bic   2009-06-03, 11:33
#9

I found a solution, please help me to understand if this can lead to other problems.
In function zipAddSubalbum($base, $offset, $subalbum) I replaced line 22:
$new_offset = $offset.$subalbum.'/';
with
if ($offset != "" AND strpos($base, $offset)) { $new_offset = $subalbum.'/'; } else { $new_offset = $offset.$subalbum.'/'; }
This seems to work, but I tested it only for my own case, as described above...

Member
Member
sbillard   2009-06-03, 16:14
#10

$zip should have been the 4th parameter to zipAddSubalbum(). As for the other code, I do not off hand see why it is needed, but I will investigate more.

Member
Member
bic   2009-06-03, 16:47
#11

I get a not needed offset before the subalbum name, when the album from wich I call the printalbumzip function is not in the root folder and is not the last folder in the albums tree.
So that:

Diocesi_Civitavecchia/S.Agostino_Civitavecchia/3133OT01/

becames

Diocesi_Civitavecchia/S.Agostino_Civitavecchia/Diocesi_Civitavecchia3133OT01/

printing zip from S.Agostino_Civitavecchia

With my code the problem is fixed but I suppose that the real error is somewhere before...

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.