Configuration:
Drupal 7.14
Bean 7.x-1.0

To produce bug:

  1. Go to block/add
  2. Receive "Call to undefined function entity_language()" fatal error in bean/includes/bean.pages.inc, line 324.

This is because the entity_language() function was added in Drupal 7.15.

It would be great if there was a check for support of the entity_language() function; if not, a note on the project page to require Drupal >=7.15 would be nice.

Thank you!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

John Bickar’s picture

Status: Active » Needs review
FileSize
557 bytes

Patchy attachy.

Status: Needs review » Needs work

The last submitted patch, bean-entitylanguagefatalerror-1912444-1.patch, failed testing.

John Bickar’s picture

Hrm, I don't understand the error message in the failed test, but here's another patch that catches the same error in the validation function.

indytechcook’s picture

Status: Needs work » Needs review

Setting to needs review so tests can run.

Status: Needs review » Needs work

The last submitted patch, bean-entitylanguagefatalerror-1912444-3.patch, failed testing.

indytechcook’s picture

+++ b/includes/bean.pages.incundefined
@@ -321,7 +321,12 @@ function bean_form($form, &$form_state, Bean $bean, $type = NULL) {
-  $langcode = entity_language('bean', $bean);
+  if(function_exists(entity_language)){
+    $langcode = entity_language('bean', $bean);

Need quotes around entity_language in the function_exists calls.

John Bickar’s picture

Status: Needs work » Needs review
FileSize
989 bytes

Right. Patching without coffee is a danger to self and others.

John Bickar’s picture

With single quotes if that syntax is preferred.

indytechcook’s picture

Status: Fixed » Closed (fixed)

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