Myself and other users get a frequent pair of error reports when editing or saving a comment. These reports are:
1. Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home/jimbsail/public_html/drupal/sites/all/themes/marinelli/template.php).
Followed by:
2. Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/jimbsail/public_html/drupal/includes/entity.inc).
I'm using Drupal 7.7, Marinelli 7.x-3.0-beta11, CKeditor and the relevant WSYWYG module. I lack the skills to determine if this is triggered by Marinelli, and then becoming a Drupal or CK editor issue. Anyone else suffering a similar set of warnings?
Comments
Comment #1
jimbaer commentedTo enlarge a bit on the above, the "1. Notice:" code refers to loading a user picture, but the users who are warned have not downloaded pictures.
The site appears to function satisfactorily in spite of the warnings.
Comment #2
therealmax commentedHi Jimbear,
Got the same message when working with comments. Tried to remove the banner in the Marinelli theme for the forum pages, problem persists.
Am running Marinelli 7.x-3.0-beta11, Wysiwyg 7.x-2.1, and CKEditor 3.6.1.7072 in D7.7.
As you report the site is working ok despite the warnings.
Comment #3
jimbaer commentedOK, Setting up user pictures removed the problem. As the code error hinted, it seems to be an incompatiblity when "user picture" is not enabled in Marinelli set-up. Then errors occur when "comments" are being handled (edited, deleted, saved). I'm not hot on php, so can't point to a fix, but obviously this gap needs to be plugged.
Comment #4
jimbaer commentedThe following pair of error reports still arise in about 1/20 edit or save activities, irrespective of user picture settings. I'm unable to establish a repeatable pattern of activities which causes the warnings. They have arisen when I've been editing/saving with admin permissions, and also with users having only permission to add comments:
1. Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home/jimbsail/public_html/drupal/sites/all/themes/marinelli/template.php).
2. Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home/jimbsail/public_html/drupal/includes/entity.inc).
I'm using CK editor, latest version, just re-installed, and the appropriate WYSYWYG partner module. No idea where to look next.
Comment #5
jimbaer commentedI posted this problem on the Drupal core forum. See http://drupal.org/node/1102570
The opinion there was "nearly 100%" this was due Marinelli coding. The warnings are still irregularly occurring, and I have been unable to establish a pattern. Only an admin sees the warnings, though sometimes they are created when users log in or add comments. On the Drupal core link you can see my full installation details. One other user there reported the same problem.
Comment #6
cdu commentedI am also seeing similar errors. Errors only appear on the admin pages after viewing a page with comments. The site otherwise appears to function properly.
This is the full list of errors that I am getting:
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
•Notice: Trying to get property of non-object in marinelli_preprocess_comment() (line 204 of /home2/garycote/public_html/ghc/sites/all/themes/marinelli/template.php).
•Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /home2/garycote/public_html/ghc/includes/entity.inc).
Comment #7
jimbaer commentedGood observation CDU. You're right. The warnings appear in "reports" after anyone views a page with comments. The warnings are in pairs, and there's one pair of warnings for each comment. So your list above would have arisen after viewing a page with six comments attached.
An admin sees the warnings in white text with red background immediately below title when he moves to a new page after vewing a page with comments. Users see nothing. Both create reports.
This suggests an error in the way Marinelli loads individual comments. But I'm no php expert, so that's the end of my ability to diagnose . . . over to the Marinelli team!
Comment #8
jimbaer commentedThe error reports noted above occur in my case when any user moves from a page with comments on to any other node. On my site, only users can see and post comments. It does not occur when anonymous users (who can't see comments) move between pages. This is a quite unacceptable feature for a production site.
To see the feature in action, go to jimbsail.info , subscribe to the site as a user, log in, then go to "play pen", and then move to any other page.
Comment #9
jimbaer commentedComment #10
jimbaer commentedOK, I've found a work-around, but the bug remains.
In Drupal account settings, enable "user pictures", appoint a pictures directory, and supply a default picture.
In Marinelli settings, toggle "user pictures in comments" on.
Errors then no longer appear. I guess a highly desirable bug fix for this would have an "if no picture" statement in the php code to cope with incompatible Drupal/Marinelli settings. This is well outside my ability and comfort zone, so I can't help further.
Comment #11
Daedalon commentedDuplicate of 1256934 and 1183598. The latter one includes a possible fix.
Comment #12
jimbaer commentedMany thanks Daedalon. That's a fix for me.
Comment #13
Daedalon commented