Recoverable fatal error: Object of class stdClass could not be converted to string in _rules_forms_display_info() (line 399 of /home/nithin/public_html/drupaltest/sites/all/modules/rules_forms/rules_forms.module).

This error arises when i enable the form inspection tool.

Hello i am getting this error report any clues as to why ? Any Solutions ?

Comments

FranckV’s picture

Same issue here... annoying

Yanxi’s picture

Same here.

thekevinday’s picture

StatusFileSize
new412 bytes

I had the same problem, please try the attached patch.

The problem is that an object is also stored on the form and the code tries to append a class object onto something else.

thekevinday’s picture

Status: Active » Needs review
andypost’s picture

StatusFileSize
new482 bytes

Suppose better to convert $data to array

Refineo’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #5 tested successfully. It removes the error.

tobiberlin’s picture

Status: Reviewed & tested by the community » Needs work

Hi

reopening this issue as the error message still appears although the path was already used in the module.

Best,
Tobias

tobiberlin’s picture

ok... it seems that this message does just appear after just activating the rules form support for a form. Now when I open the form again the message does not appear anymore. However: although my module version had this patch already fixed the message appeared in my new installation.

Additionally I do not see any information about the form elements from form element inspection tool?!

kardave’s picture

Hi,

I only have this error, when I enable the "Enable form element inspection tool" option. The first option (Enable event activation messages on forms) doesn't raise error.

David

kardave’s picture

Patch in #5 dissolved the error in my case :)

Thanks!

c-logemann’s picture

Version: 7.x-2.x-dev » 7.x-1.x-dev
Status: Needs work » Reviewed & tested by the community

I just tested the 7.x-2.x-dev branch where I didn't find the feature "inspection tool" and I can't apply the patch.
But in 7.x-1.x-dev branch the patch #5 is solving this issue and I can use the "inspection tool".

nwom’s picture

Had the same problem. Thanks for the patch.

dooug’s picture

Title: Strange Recoverable fatal error while using rules from » "Recoverable fatal error" while using rules forms
StatusFileSize
new846 bytes

re-rolled for latest 7.x-1.x-dev. Worked for me.

therobyouknow’s picture

Good news - patch in #13 worked for me too but I needed to edit the email header and tail first to be able to use the patch.

See my terminal log below, before and after and showing the dates of my rules_forms files if that helps you and how (and where I applied the patch):

robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ wget https://drupal.org/files/rules_forms-recoverable_fatal_error-1542280-13....
--2013-09-20 12:32:40-- https://drupal.org/files/rules_forms-recoverable_fatal_error-1542280-13....
Resolving drupal.org (drupal.org)... 140.211.10.62, 140.211.10.16
Connecting to drupal.org (drupal.org)|140.211.10.62|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 846 [text/plain]
Saving to: ‘rules_forms-recoverable_fatal_error-1542280-13.patch’

100%[=============================================================================>] 846 --.-K/s in 0s

2013-09-20 12:32:42 (96.3 MB/s) - ‘rules_forms-recoverable_fatal_error-1542280-13.patch’ saved [846/846]

robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ ls
CHANGELOG.txt README.txt rules_forms.install rules_forms.rules.inc
includes rules_forms.css rules_forms.module rules_forms.test
LICENSE.txt rules_forms.info rules_forms-recoverable_fatal_error-1542280-13.patch
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ ls -l
total 108
-rw-rw-rw- 1 root root 2814 Feb 22 2012 CHANGELOG.txt
drwxrwxrwx 2 root root 4096 Sep 19 12:01 includes
-rw-rw-rw- 1 root root 18092 Sep 17 2011 LICENSE.txt
-rw-rw-rw- 1 root root 5318 Feb 22 2012 README.txt
-rw-rw-rw- 1 root root 1670 Feb 22 2012 rules_forms.css
-rw-rw-rw- 1 root root 385 Feb 22 2012 rules_forms.info
-rwxrwxrwx 1 root root 1535 Feb 22 2012 rules_forms.install
-rwxrwxrwx 1 root root 16327 Feb 22 2012 rules_forms.module
-rw-r--r-- 1 robd www-data 846 Sep 17 02:50 rules_forms-recoverable_fatal_error-1542280-13.patch
-rwxrwxrwx 1 root root 16662 Feb 22 2012 rules_forms.rules.inc
-rw-rw-rw- 1 root root 19921 Feb 22 2012 rules_forms.test
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ cat rules_forms-recoverable_fatal_error-1542280-13.patch
From 90fd71f4fa8ecf5a80448f9718a6aaa0fd874e7e Mon Sep 17 00:00:00 2001
From: dooug
Date: Mon, 16 Sep 2013 21:49:09 -0400
Subject: [PATCH] Issue #1542280: fixes 'recoverable fatal error' when adding
a form for rules_forms.

---
rules_forms.module | 3 +++
1 file changed, 3 insertions(+)

diff --git a/rules_forms.module b/rules_forms.module
index 854c2a3..3b3a205 100755
--- a/rules_forms.module
+++ b/rules_forms.module
@@ -387,6 +387,9 @@ function rules_forms_add_popups(&$form, $elements) {
* to demonstrate the structure of an array to the user.
*/
function _rules_forms_display_info(&$element, $data, $level = 1, $delta = NULL) {
+ if (is_object($data)) {
+ $data = (array) $data;
+ }
if (is_array($data) && $level != 3) {
$element .= $delta;
$element .= '

    ';
    --
    1.7.9.5

    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ ls
    CHANGELOG.txt LICENSE.txt rules_forms.css rules_forms.install rules_forms-recoverable_fatal_error-1542280-13.patch rules_forms.test
    includes README.txt rules_forms.info rules_forms.module rules_forms.rules.inc
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ cp rules_forms-recoverable_fatal_error-1542280-13.patch rules_forms-recoverable_fatal_error-1542280-13.patch.orig
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ ls
    CHANGELOG.txt LICENSE.txt rules_forms.css rules_forms.install rules_forms-recoverable_fatal_error-1542280-13.patch rules_forms.rules.inc
    includes README.txt rules_forms.info rules_forms.module rules_forms-recoverable_fatal_error-1542280-13.patch.orig rules_forms.test
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ vi rules_forms-recoverable_fatal_error-1542280-13.patch
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ vi rules_forms-recoverable_fatal_error-1542280-13.patch
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ vi rules_forms-recoverable_fatal_error-1542280-13.patch
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ patch < rules_forms-recoverable_fatal_error-1542280-13.patch
    patching file rules_forms.module
    Hunk #1 succeeded at 368 (offset -19 lines).
    robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$ cat rules_forms-recoverable_fatal_error-1542280-13.patch
    --- a/rules_forms.module
    +++ b/rules_forms.module
    @@ -387,6 +387,9 @@ function rules_forms_add_popups(&$form, $elements) {
    * to demonstrate the structure of an array to the user.
    */
    function _rules_forms_display_info(&$element, $data, $level = 1, $delta = NULL) {
    + if (is_object($data)) {
    + $data = (array) $data;
    + }
    if (is_array($data) && $level != 3) {
    $element .= $delta;
    $element .= '

      ';
      robd@DevWeb:/var/www/go-on/rob/sites/all/modules/rules_forms$
maximpodorov’s picture

Issue summary: View changes

Chances to commit?

c-logemann’s picture

Chances to commit?

I think currently not. There is no active maintainer. The information "looking for a co-maintainer" is also some years old. Maybe somebody will pay for development?

By myself I really like the idea of this module and when I find the time to get deeper involved I will ask for maintainership.
There is a a big complexity already in the current two 7.x branches and I believe also 8.x will bring some more complexity. So even if I start to get involved maybe I will start only with 8.x and if I will support 7.x I will make a decision for only one of the 7.x branches.

kenorb’s picture

Status: Reviewed & tested by the community » Needs work

The patch in #13 looks like workaround, so I think we need to first understand why we've got object instead of array and if this is expected behaviour.

Somebody needs to provide some backtrace why this is happening and how we can fix it in a proper way.

kenorb’s picture

caminadaf’s picture

This happens because on node forms we have the '#node' element, which has the loaded object of the node.

I conditioned the code so that #node and #entity elements don't go through _rules_forms_display_info, but also kept the patch #13 to prevent any possible errors.

  • caminadaf committed d629ecd on 7.x-1.x authored by dooug
    Issue #1542280 by thekevinday, andypost, dooug, caminadaf: "Recoverable...
caminadaf’s picture

Status: Needs work » Fixed

Commited on 7.x-1.x-dev

Status: Fixed » Closed (fixed)

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