Download & Extend

Fatal Error: Call to undefined function entity_language()

Project:Bean
Version:7.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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!

Comments

#1

Status:active» needs review

Patchy attachy.

AttachmentSizeStatusTest resultOperations
bean-entitylanguagefatalerror-1912444-1.patch557 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Repository checkout: failed to create dependency directory.View details

#2

Status:needs review» needs work

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

#3

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.

AttachmentSizeStatusTest resultOperations
bean-entitylanguagefatalerror-1912444-3.patch985 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 94 pass(es), 0 fail(s), and 2 exception(s).View details

#4

Status:needs work» needs review

Setting to needs review so tests can run.

#5

Status:needs review» needs work

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

#6

+++ 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.

#7

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
bean-entitylanguagefatalerror-1912444-7.patch989 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 94 pass(es).View details

#8

With single quotes if that syntax is preferred.

AttachmentSizeStatusTest resultOperations
bean-entitylanguagefatalerror-1912444-8.patch989 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 94 pass(es).View details

#9

#10

Status:fixed» closed (fixed)

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