Notice: Array to string conversion in field_group_field_group_to_hook_code() (line 2289 of sites/all/modules/contrib/field_group/field_group.module).
Notice: Undefined property: stdClass::$Array in field_group_field_group_to_hook_code() (line 2289 of sites/all/modules/contrib/field_group/field_group.module).

Files: 
CommentFileSizeAuthor
#2 field_group-php7-2661484-2.patch736 bytesheddn

Comments

heddn created an issue. See original summary.

heddn’s picture

Status: Active » Needs review
FileSize
736 bytes
MustangGB’s picture

Status: Needs review » Reviewed & tested by the community

Also works for 7.x-1.x

heddn’s picture

RajabNatshah’s picture

Thank you :)

Rewarded work.

geekygnr’s picture

I just tried #2 and it works for me.

vincenzodb’s picture

#2 worked for me tnx

milopca’s picture

#2 also works for me. Thanks!

danharper’s picture

#2 working for me too.

DrupalThomas’s picture

#2 working for me too (on the stable branch)
would be great to commit this line to have php7 compatibility on the stable version of this module

jiv_e’s picture

Works for me!

jiv_e’s picture

Status: Closed (duplicate) » Reviewed & tested by the community
MustangGB’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Plazik’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Why this marked as duplicate without link to the issue?

This patch works for me.

MustangGB’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
rahul_sankrit’s picture

#2 this patch worked for me for php7 compatibility (PHP Version 7.0.15-0ubuntu0.16.04.4).

I were getting following notices:

  1. Notice: Array to string conversion in field_group_field_group_to_hook_code() (line 2261 of /modules/contrib/field_group/field_group.module).
  2. Notice: Undefined property: stdClass::$Array in field_group_field_group_to_hook_code() (line 2261 of /modules/contrib/field_group/field_group.module).
diff --git a/field_group.module b/field_group.module
index 412825f..4061519 100644
--- a/field_group.module
+++ b/field_group.module
@@ -2258,7 +2258,7 @@ function field_group_field_group_to_hook_code($data, $module) {
   $code .= "  \${$export['identifier']}s = array();\n\n";
   foreach ($objects as $object) {
     $code .= ctools_export_object('field_group', $object, '  ');
-    $code .= "  \${$export['identifier']}s['" . check_plain($object->$export['key']) . "'] = \${$export['identifier']};\n\n";
+    $code .= "  \${$export['identifier']}s['" . check_plain($object->{$export['key']}) . "'] = \${$export['identifier']};\n\n";
     if (!empty($object->data['label'])) {
       $translatables[] =  $object->data['label'];
     }

Thanks