I get this error when trying to view a node that has a field collection in it: Fatal error: Call to undefined function entity_i18n_string() in PATH/field_collection.module on line 869 (I replaced the actual path with PATH)
The error goes away when I disable the add/edit/delete links, i.e. choose format 'Fields only' under manage display of the node. I assume it will go away as well if you install i18n.

CommentFileSizeAuthor
#10 0001-1513406.patch1.14 KBchaskype
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ro-no-lo’s picture

Can confirm it. There seem to be a new requirement for field_collection.

ro-no-lo’s picture

Quickfix, compared versions: (find all 3 places for yourself)

Before:
$links[] = l($settings[$op], $field_collection->path() . '/' . $op, array('query' => drupal_get_destination()));

After:
$title = entity_i18n_string("field:{$field['field_name']}:{$instance['bundle']}:setting_$op", $settings[$op]);
$links[] = l($title, $field_collection->path() . '/' . $op, array('query' => drupal_get_destination()));
scottrouse’s picture

Status: Active » Closed (works as designed)

This is a sneaky one. The recent Field Collection release requires the latest dev version of the Entity API module.

It's a bit hidden in the release notes for Field Collection 7.x-1.0-beta4 and refers to #1446674: make the interface translatable.

I can confirm that updating to the April 2 dev release of Entity API resolves this error message.

Donatoo’s picture

I confirm the dev release of Entity API solves the problem.

BTMash’s picture

I don't know what other changes made it into entityapi for dev (and if it might cause some funky issues). So I made a patch to just get the i18n string in (below is my svn diff).

Index: contrib/entity/entity.module
===================================================================
--- contrib/entity/entity.module	(revision 1866)
+++ contrib/entity/entity.module	(working copy)
@@ -1041,6 +1041,23 @@
 }
 
 /**
+ * Helper for using i18n_string().
+ *
+ * @param $name
+ * Textgroup and context glued with ':'.
+ * @param $default
+ * String in default language. Default language may or may not be English.
+ * @param $langcode
+ * (optional) The code of a certain language to translate the string into.
+ * Defaults to the i18n_string() default, i.e. the current language.
+ *
+ * @see i18n_string()
+ */
+function entity_i18n_string($name, $default, $langcode = NULL) {
+  return function_exists('i18n_string') ? i18n_string($name, $default, array('langcode' => $langcode)) : $default;
+}
+
+/**
  * Implements hook_views_api().
  */
 function entity_views_api() {
rooby’s picture

Thanks BTMash, I also have lots of entity dependent functionality and patches that mean updating entity required a reasonable amount of time for review of changes and testing, so that helps for the interim.

rgon’s picture

Thanks, BTMash. I'm using the patch also.

etibmw’s picture

Good one BTMash
added the patch (#5) and it is working now
problem solved!
thanks

zorroposada’s picture

I was receiving error message from field_collection.

#5 Worked for me too.

Thanks

chaskype’s picture

FileSize
1.14 KB

Same patch in git

Path: sites/all/entity

use this command

git apply -v 0001-1513406.patch

DRUPALON’s picture

thanks #5 works fine

bcweaver’s picture

It looks to me like the latest release of Entity API -- 7.x-1.0-rc2 -- fixes this.

30equals’s picture

Got this error as well, and can confirm that updating to the latest dev version of Entity API fixes this.

jwilson3’s picture

As this bug renders the recommended version of field_collection module completely *unusable*, when could we expect a new beta release?

UPDATE: Oops, I mis-read the above, that the fix is found in the *entity* module, not this module.

rachelf’s picture

Entity API release 7.x-1.0-rc3 also fixes this.

drupix’s picture

Confirmed: Entity API release 7.x-1.0-rc3 fixes this.

Sridar’s picture

Its Working.. Long time issue, Fixed. Thanks for the updated patch @chaskype.