When I enable the Millennium Integration module I get the following error on most front-end pages. This appears to happen on any page that's rendering node content, even if the page has no millennium associated content.

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted [...]

I have tested this on a fresh Drupal installation, and with both the alpha and dev versions of the module. I have tried increasing php memory_limit as high as 1000mb, without any luck.

Comments

eusonic’s picture

Title: PHP Fatal error, memory limit exceeded » Fatal error in Drupal 7.22
Priority: Normal » Critical

I did some more testing and this problem only exists in Drupal 7.22. I rolled back to 7.21 and everything works perfectly.

Activating this module in Drupal 7.22 will make all node pages unaccessible. I'm elevating this bug to critical.

janusman’s picture

Hello! Thanks for the report. I will work on reproducing this soon... In the meantime having the output of php -v might be helpful.

eusonic’s picture

PHP 5.3.15

Thanks
-Cameron

janusman’s picture

Version: 7.x-2.0-alpha1 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.25 KB

Following patch seems to fix the problem. Please review.

Index: millennium.module
===================================================================
--- millennium.module	(revision )
+++ millennium.module	(revision )
@@ -3171,16 +3171,19 @@
  *   The weight.
  */
 function millennium_element_weight($element_name, $view_mode = 'full') {
+  static $defaults, $settings;
+  if (!isset($defaults)) {
-  $defaults = array(
-    'millennium_coverimage' => -100,
-    'millennium_authors' => -91,
-    'millennium_extra' => -90,
-    'millennium_google_books' => -80,
-    'millennium_holdings' => -50,
-    'millennium_biblio_data' => 0,
-    'millennium_googlebookswidget' => 100,
-  );
-  $settings = field_extra_fields_get_display('node', variable_get('millennium_marc_node_type', 'page'), $view_mode);
+    $defaults = array(
+      'millennium_coverimage' => -100,
+      'millennium_authors' => -91,
+      'millennium_extra' => -90,
+      'millennium_google_books' => -80,
+      'millennium_holdings' => -50,
+      'millennium_biblio_data' => 0,
+      'millennium_googlebookswidget' => 100,
+    );
+    $settings = field_extra_fields_get_display('node', variable_get('millennium_marc_node_type', 'page'), $view_mode);
+  }
 
   if (isset($settings[$element_name]['weight'])) {
     return $settings[$element_name]['weight'];
janusman’s picture

Status: Needs review » Fixed

Committed to Dev!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Status: Closed (fixed) » Needs work

The last submitted patch, 4: millennium-2040177-recursive-field-element-weight.patch, failed testing.

janusman’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)

Silly testbot!