Whenever a device is reserved (bucket or resource) if another person trys to reserve or preview the same reserve time without clicking the "Limit Lists to Available Items" first, the page throws this error:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 79 bytes) in C:\xampp\htdocs\drupal\modules\merci\theme\theme.inc on line 111

I have jacked memory all the way to 1gb on the php.ini and the theme.inc with no avail. Is there a way to force the page to only display items availabel by default?

Comments

darrick’s picture

When this happens for a bucket how many items do you have for the bucket. What hours of operation do you have? There is this bug: http://drupal.org/node/1199048 which I haven't had a chance to look at. Usually whenever I have memory exhaustion it's due to an infinite loop.

richbcph’s picture

I'll check out the patch.

Site hours:
M,T,W,T,F,Sa,Su 01:00-24:00 w/ No close dates. All items available weekend and over night.

As for the buckets I have 2 buckets setup one with 4 and one with 2. Also happens with resources.

richbcph’s picture

That patch was it. Initially I just set the hours to 23 instead of 24 and it worked. I applied the patch (simply copying and editng the code from the patch) into the theme.inc file and it worked!

Note to anyone else running windows. I read many a tutorial on how I had to run patch.exe and unix2dos.exe and patch.bat and had nothing but issues. If you read your error code there is a good chance you can just copy the new patched code into the offending file and save it diretcly using notepad.

example:

Patch update code:

diff --git a/theme/theme.inc b/theme/theme.inc
index dda4c94..add6f25 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -121,6 +121,10 @@ function template_preprocess_merci_conflict_grid(&$variables) {
while ($time < $hours[$day]['close']) {
$pretty_hours[$date][] = date('ga', strtotime($time));
$time = date('H:i', strtotime($time . ' +1 hour'));
+ //avoids overflow to next day
+ if($time < '01:00') {
+ break;
+ }
}
}

All I needed from that patch was (without the + signs):

while ($time < $hours[$day]['close']) {
$pretty_hours[$date][] = date('ga', strtotime($time));
$time = date('H:i', strtotime($time . ' +1 hour'));
+ //avoids overflow to next day
+ if($time < '01:00') {
+ break;
+ }
}
}

Hope this helps someone down the road.

Thanks again for your help :)

darrick’s picture

Component: Merci UI » Code
Status: Active » Closed (duplicate)

Thanks for checking this out. I'm closing this issue but leaving http://drupal.org/node/1199048 open until I get a chance to commit the fix.