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!

Files: 
CommentFileSizeAuthor
#8 bean-entitylanguagefatalerror-1912444-8.patch989 bytesJohn Bickar
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es). View
#7 bean-entitylanguagefatalerror-1912444-7.patch989 bytesJohn Bickar
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es). View
#3 bean-entitylanguagefatalerror-1912444-3.patch985 bytesJohn Bickar
FAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 2 exception(s). View
#1 bean-entitylanguagefatalerror-1912444-1.patch557 bytesJohn Bickar
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to create dependency directory. View

Comments

John Bickar’s picture

Status: Active » Needs review
FileSize
557 bytes
FAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to create dependency directory. View

Patchy attachy.

Status: Needs review » Needs work

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

John Bickar’s picture

FileSize
985 bytes
FAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 2 exception(s). View

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
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es). View

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

John Bickar’s picture

FileSize
989 bytes
PASSED: [[SimpleTest]]: [MySQL] 94 pass(es). View

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.