[Bins] Patch against problem of empty Root Album Name

Martin Pohlack mp26 at os.inf.tu-dresden.de
Mon Sep 5 21:45:43 BST 2005


Hi,

when building an bins album without an explicitly given root name via
album.xml bins uses just "" (empty string) for the root album.

This leads to problems with the generation of the albums trees with at
least the marc and the joi templates (unbalanced html tags).  Also,
there is no visible link for the root album in the tree, as the link has
a length of zero.  Additionally, the path rendering for the album is
missing the initial part.

I propose to use the last part of the source dir if no name is given,
using the following path:

@@ -2431,6 +2431,12 @@
         $albuminfo{title} = local2html($albumtitle) ;
     }
     beVerboseN("title for album $album is $albuminfo{title}.", 3);
+    if ($albuminfo{title} eq "")
+    {
+        $albuminfo{title} = $picdir;
+        chop($albuminfo{title});
+        $albuminfo{title} =~ s/^.*\///g; #remove path
+    }
     return (\%albuminfo, $configHash);
 }




The line numbers for the patch might be a bit off with the current cvs
version but there should be no conflict.

I'm also not entirely sure whether using the last part of the source
directory or of the destination directory would be better?  I tend to
have well organized names in the source part, generate to temp dirs, and
then copy the images to the web server, so I took the source approach.
Otherwise replace $picdir with $albumdir.


Regards,
Martin Pohlack


More information about the Bins mailing list