I just upgraded to 1.4-rc1 on my site and now the random image block is broken.
It keeps telling me that my configuration was created with an old version of gallery, even though I have updated the config and the gallery itself works fine (both within and outside of Postnuke)
Any ideas?
Posts: 794
You will need to stick with something pre 1.4.1-cvs-b12 for the time being as the code is fixed or someone can post the fixed code here for you to mod.
Posts: 9
If someone can post the code to mod, I'd appreciate it.
Posts: 794
My mistake. Unless others have it running on their 1.4 versions, I'll have to suggest you go back to 1.3.4 stable. The PostNuke Random Block has not been updated since then. See Jörg's site What version did you upgrade from?
Posts: 9
1.3.4
Posts: 5
There is a random block on this site and it's obviously working with 1.4.1. Perhaps dev team will be so kind and release the code.
Posts: 3474
This site (running 1.4.1-cvs-b1) uses the standalone random block, not the PostNuke random block. The standalone block should still work fine (though it has a couple of small known bugs... ask about them if they crop up).
-Beckett (
)
Posts: 5
Thank you for your prompt reply. I've tried the random photo block, but I have one problem.
I put block-random.php in /modules/gallery folder, modified index.php with"block-random.php" line, created a new PHP block with
include("http://your.server/modules.php?op=modload&name=your-gallery-name&file=index&include=block-random.php");
, but i see onlyinstead of an image.
I have entered my URL and the name of the gallery (Galerija LDS Kamnik)in above code.
Is it important where albums folder is? I have it in root directory of the site, so I wonder if that is a problem?
Posts: 6
I'm getting
Warning: rand() expects parameter 2 to be long, string given in /www/htdocs/modules/gallery/block-random.php on line 138
ERROR: requested index [] out of bounds [47]
Fatal error: Call to a member function on a non-object in /www/htdocs/modules/gallery/classes/Album.php on line 702
Posts: 3474
:: jure ::
Try renaming your Gallery module to not have any spaces. If that doesn't work, we'll try something else.
:: LGK ::
You've found one of the bugs I mentioned.
In block-random.php find this line:
$choose = rand(1, $count);
and replace it with
$choose = rand(1, (int) $count);
As for the out of bounds error, remember that the cache file only updates once every 24 hours. If you remove it, it will update again right away.
-Beckett (
)
Posts: 3
I've just spent the last 3 hours chasing this down and now have mine working with Gallery V1.4-pl1. Before anyone rushes off to mod their online version, just bear in mind that I was hacking a test version on my test server and could suffer any hardship that followed. Make sure you can too :wink:
I offer no guarantees with this, but I think I got to the root of the problem.
For those wanting to get straight to it, here's what you have to do:
The gallerySanityCheck() function in the util.php file located in the root gallery folder makes a check between the version number stored in config.php and that stored in Version.php using this line if ($gallery->app->config_version != $gallery->config_version). The first part of the check $gallery->app->config_version returns the value 48. The second part, $gallery->config_version, returns nothing, then the configuration error message is generated.
To correct it, the $gallery->config_version variable has to be brought into scope within the function. Add the following line highlighted in red to the function located in the util.php file starting at line 993:
function gallerySanityCheck() {
global $gallery;
global $GALLERY_BASEDIR;
require($GALLERY_BASEDIR."Version.php");
if (!fs_file_exists($GALLERY_BASEDIR . "config.php") ||
brok...
The $gallery->config_version variable will also now return 48 from the Version.php file and will allow the random image to be generated.
I'm not sure why the require directive for the Version.php file in init.php isn't allowing this variable to be seen, but the include directive for the config.php file is allowing the other variable. I'm sure one of the experts here can shed some further light on the subject. :D
Posts: 4
Thanks for the info blackcat...It worked like a champ :D
Posts: 3
Thanks mate. Nice it's been of use to someone :D
Posts: 33
Whatr means this error ?
Posts: 3
It's trying to include the errors/configure_instructions.php file from the modules/gallery/errors directory, but can't as it says it doesn't exist.
Have you checked the errors directory to make sure the file is there?
Posts: 11
Blackcat: "You Da Man" That worked like a charm.
Now, do you have any clever ideas on how to make "Last Gallery Updates" block work simultaneously with "Random Photo" block?
It can't now because the declare the same header or something.
Posts: 11
AMEN - Blackcat is Da Man - worked great for me as well.
Thanks!
Posts: 4
BlackCat - I mod'ed the file as suggested. The random block image now shows up, but am getting this WARNING right above the image:
Which is:
Using PN 7.2.6 / Gallery 1.4.1-RC3.
Can see on: mikesjourneys.com
Odd note after I posted the above: Only get this warning if logged into site. If not logged in, don't get the warning .... hmmmmm :-?
Posts: 9
The same thing happened to me when I tried the fix. Same exact mySQL error.
Posts: 794
This should fix your problem: Photo Block.
Posts: 9
Thanks - that fixed it!
Posts: 4
Yup, that fixed the problem for me too !! :D
Posts: 3
function gallerySanityCheck() {
global $gallery;
global $GALLERY_BASEDIR;
require($GALLERY_BASEDIR."Version.php");
if (!fs_file_exists($GALLERY_BASEDIR . "config.php") ||
brok...
Thanks, great help because it now works....