Download & Extend

Illegal string offset warnings when taking quiz

Project:Quiz
Version:7.x-4.0-alpha12
Component:Code - other
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:php5.4

Issue Summary

Hi,

I get a bunch of warnings, when ever i take a quiz with multichocie question. I created a quiz with just one multichoice question. when i take the quiz i get the following warnings.

I am using PHP 5.4.3.

    Warning: Invalid argument supplied for foreach() in element_children() (line 6282 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5761 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5771 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5809 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#printed' in drupal_render() (line 5816 of /srv/http/ephemeral/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6282 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5761 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5771 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5809 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#printed' in drupal_render() (line 5816 of /srv/http/ephemeral/includes/common.inc).
    Warning: Invalid argument supplied for foreach() in element_children() (line 6282 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5761 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5771 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#children' in drupal_render() (line 5809 of /srv/http/ephemeral/includes/common.inc).
    Warning: Illegal string offset '#printed' in drupal_render() (line 5816 of /srv/http/ephemeral/includes/common.inc).

Comments

#1

Status:active» postponed (maintainer needs more info)

I'm not able to reproduce this one.

#2

I guess, this may have to do with new version of php (5.4) http://mark-story.com/posts/view/new-errors-in-php-5-4

May be somewhere quiz may pass non-array types to drupal_render(&$elements). I am just guessing. Iwill take a look at this weekend, if i get a chance.

#3

Dit you find the reasson of the error? because I`ve got the same problem. Also php 5.4

#4

Priority:normal» minor
Status:postponed (maintainer needs more info)» active

Thanks, seems to be php 5.4 problem

#5

I have the same problem. Any solution?

#6

subscribe

#7

Status:active» needs review

possible fix.

AttachmentSize
1630032-fix-for-illegal-string-offset-warning-6818331.patch 491 bytes

#8

Version:7.x-4.0-alpha5» 7.x-4.0-alpha12
Component:Code - Multichoice» Code - other

Thanks lakshminp, it works fine for me.

#9

We are using 7.x-4.0-alpha with postgreSQL and PHP 5.4 and this fix worked great for us as well.

Hope we see it in the next release.

#10

Status:needs review» fixed

Thanks for the patch. Fix committed to git.

#11

Status:fixed» closed (fixed)

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

nobody click here