Active
Project:
Heartbeat
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
12 Sep 2012 at 03:02 UTC
Updated:
15 Feb 2022 at 13:05 UTC
Jump to comment: Most recent
Comments
Comment #1
salomos commentedI have the same error but I am not using Heartbeat. I am using Drupal Commerce Kickstart. Does anyone know how to fix this problem?
Comment #2
bblancha commentedI have a similar error with core 7.18 and content access.
I get
"Array to string conversion in form_process_checkbox() (line 3144..."
error whenever I try to set access permissions say on the Article content type. I have a generic configuration, no new content types or customization. Just core 7.18 with a list of modules installed. No content was added yet.
Forgot to mention as I think it may be the problem. My host has moved to PHP 5.4.9. Could this be a problem? I cannot revert to an earlier version of PHP
Comment #3
ramsunvtech commentedGuys,
I think problem with return value defined as array in your custom module. I checked out the Drupal 7 core code in the "includes\form.inc" file (http://api.drupal.org/api/drupal/includes!form.inc/7)
In line number: 3126 - Its a value which we set for the element
$value = $element['#value'];
For your Reference: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
In line number: 3127 - Its a value element should return when selected
$return_value = $element['#return_value'];
For your Reference: http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
This will go to else condition if the "$element['#value']" is string and not a Boolean also not a zero. Now, i will explain why u got this error because in your case you got the return value as array. as per the line number:3144, the return value has been converted to string
line number:3144 - $element['#checked'] = ((string) $value === (string) $return_value);
Happy to receive your replies.
Warm Regards,
Venkat
Comment #4
jamescarvin commentedEverything you have stated, Venkat, is what is written on the corresponding lines. How should the line read so that it does not produce the error in line 3144?
Comment #5
rorevaz commentedOnce that the necessary result is 0 or 1 (an integer number anyway) I have changed the type of string to int as follow.
$element['#checked'] = ((string) $value === (string) $return_value); changed to
to $element['#checked'] = ((int) $value === (int) $return_value);
and the problem was solved.
Comment #6
kebz commentedI get this notice below whenever I click on the "add" button under the Heartbeat Templates and Heartbeat Plugins.
Comment #7
Arunah commentedThx rorevaz, works for me.
Comment #8
marinex commentedHi, this issue is because in the function pluginAttachmentForm should be:
'#default_value' => isset($form_values['settings'][$this->settings['plugin_name']]['activitycomments_node']) ? $form_values['settings'][$this->settings['plugin_name']]['activitycomments_node'] : false,
not
'#default_value' => isset($form_values['settings'][$this->settings['plugin_name']]['activitycomments_node']) ? $form_values['settings'][$this->settings['plugin_name']]['activitycomments_node'] : array(),
Notice: false instead of the array()
You do not hack core!!!
Marinex
Comment #9
avpaderno