| Author |
Message |
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 01, 2003 6:14 pm Post subject: New errors |
|
|
i got some errors on my random blocks...they were working fine, then all of the sudden i started getting these errors...
Code: › Warning: rand() expects parameter 2 to be long, string given in /home/virtual/site21/fst/var/www/html/html/modules/gallery/random_support.php on line 203
ERROR: requested index [] out of bounds [4]
Fatal error: Call to a member function on a non-object in /home/virtual/site21/fst/var/www/html/html/modules/gallery/classes/Album.php on line 669
|
|
| Back to top |
|
|
AdBot
|
|
| Back to top |
|
 |
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Jul 07, 2003 7:24 am Post subject: |
|
|
| hmm...did you upgrade gallery to a new CVS version, or did this just start popping up? |
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Mon Jul 07, 2003 8:12 am Post subject: |
|
|
| nope...nothing changed...i installed the blocks, got them working perfectly, went back a couple of days later and there were errors...i hadn't touched it |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Mon Jul 07, 2003 8:22 am Post subject: Re: New errors |
|
|
| hmm, let me catch up on some work and then i'll take a look at this and get back to you. |
|
| Back to top |
|
|
DaveJWood
Beginner


Joined: Jun 25, 2003 Posts: 2 Location: Sawley, North Yorkshire, UK
|
Posted: Tue Jul 08, 2003 3:29 am Post subject: Re: New errors |
|
|
I'm getting the same error. It's fine for a while then along comes the "rand() expects parameter 2 to be long" error.
Would be very interested for a fix for this one.
 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue Jul 08, 2003 6:03 am Post subject: |
|
|
ok, here is the offending line:
Code: › $choose = rand(1, $count);
you could put a simple line like this:
Code: › echo $count;
immediately before that line and see what it returns. post the results here. i have a workaround, but it's not (in my mind) a good fix. |
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 08, 2003 6:42 am Post subject: Re: New errors |
|
|
ok, here is the result
Code: › 3
Warning: rand() expects parameter 2 to be long, string given in /home/virtual/site21/fst/var/www/html/html/modules/gallery/random_support.php on line 204
ERROR: requested index [] out of bounds [4]
Fatal error: Call to a member function on a non-object in /home/virtual/site21/fst/var/www/html/html/modules/gallery/classes/Album.php on line 669 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue Jul 08, 2003 7:30 am Post subject: Re: New errors |
|
|
try this for the echo statement:
Code: › echo gettype($count);
what's that produce? |
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 08, 2003 7:41 am Post subject: Re: New errors |
|
|
ok, now its this
Code: › string
Warning: rand() expects parameter 2 to be long, string given in /home/virtual/site21/fst/var/www/html/html/modules/gallery/random_support.php on line 204
ERROR: requested index [] out of bounds [4]
Fatal error: Call to a member function on a non-object in /home/virtual/site21/fst/var/www/html/html/modules/gallery/classes/Album.php on line 669
|
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 08, 2003 7:48 am Post subject: |
|
|
i dont know if the two are related, but in my second gallery (i have 2) i am getting this error now...and it is new too, it worked for a while and now it is appearing
Fatal error: Call to a member function on a non-object in /home/virtual/site21/fst/var/www/html/html/modules/gallery2/classes/AlbumDB.php on line 162 |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue Jul 08, 2003 8:16 am Post subject: |
|
|
hmm..i think it may have to do with how Gallery does it's serialization. try putting the following block of code:
Code: ›
if(!is_int($count)) {
settype($count, "int");
}
underneath these lines:
Code: ›
function choosephoto($album) {
global $cache;
$count = $cache[$album->fields["name"]]; |
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 08, 2003 8:36 am Post subject: |
|
|
worked...any ideas on the error i am getting in my second gallery i referred to above?
also, i attempted to put 2 random blocks on the same page but i get constant "cannot redeclare" errors on a ton of functions, so short of going in and renaming all the functions is there anything i can do? |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue Jul 08, 2003 8:41 am Post subject: Re: New errors |
|
|
i'm not sure about the second gallery issue...i know on the gallery site they have tips on running multiple galleries in one domain.
as for the multiple random blocks, what are the specific errors you're getting? |
|
| Back to top |
|
|
inSaNE_iRIsH
Wizard


Joined: Jun 19, 2003 Posts: 101
|
Posted: Tue Jul 08, 2003 9:30 am Post subject: Re: New errors |
|
|
here is an example
Code: › Fatal error: Cannot redeclare fs_copy() (previously declared in /home/virtual/site21/fst/var/www/html/html/modules/gallery/platform/fs_unix.php:22) in /home/virtual/site21/fst/var/www/html/html/modules/gallery2/platform/fs_unix.php on line 22
but if i rename the fs_copy function to fs_copy2 i get a new error for whatever the next function is....if i rename all the functions in the fs_unix.php file i start getting errors on all the functions in the random_support.php file that is in gallery2... |
|
| Back to top |
|
|
dari
Site Admin


Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
|
Posted: Tue Jul 08, 2003 9:52 am Post subject: |
|
|
| gotcha...yeah, this isn't a random block issue...this is because of the fact that you're essentially running two instances of gallery on the server, so all the functions are declared twice. give me a few and i'll post a solution. |
|
| Back to top |
|
|
|
|
|
|
|