Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
I get an error about 1 out of every 6 times I load my site using four seasons that crashes the header image and says:
Undefined offset: -1 in fourseasons_show_banner() (line 143 of sites/all/themes/fourseasons/template.php).
Is there anything I can do to fix this? I have built a great site with this theme, but obviously can't have people greeted with no banner image and an error message. Any advice would be greatly appreciated!
Comments
Comment #1
aiw_2000 CreditAttribution: aiw_2000 commentedI had the same problem. The issue only occurs if you have more than one header image. The code calculating the random image number is incorrect on line 141:
If rand() chooses "0", then $i becomes -1, hence the error reported. The fix is to simply move the "-1" as follows:
The code now works as intended with no errors.
Comment #2
ccentenrun CreditAttribution: ccentenrun commentedThanks!!! :)