Setting open date and close date gives me these errors in quiz_validate as both $node->quiz_open and $node->quiz_close are strings not arrays:

Warning: Illegal string offset 'month' a quiz_validate() (línia 1452 /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'day' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'year' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'month' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'day' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'year' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).

Just replacing statement with mktime by untouched $node properties fixes these errors.

CommentFileSizeAuthor
#3 quiz-quiz_validate-2387753-0.patch638 bytesaleix
quiz_validate.patch645 bytesaleix
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djdevin’s picture

Version: 7.x-5.0-alpha7 » 7.x-5.x-dev
Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, quiz_validate.patch, failed testing.

aleix’s picture

FileSize
638 bytes
djdevin’s picture

Status: Needs work » Needs review
djdevin’s picture

This patch passes tests, but could you give me the steps to reproduce the warnings? I couldn't get it to break.

aleix’s picture

Let's see if I remember what happened...
I am testing again with the content type quiz, using the unpatched quiz.module, with the default content type (quiz). If I am entering both start and end date I get a bunch of errors:

Warning: Illegal string offset 'month' a quiz_validate() (línia 1452 /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'day' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'year' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'month' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'day' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).
Warning: Illegal string offset 'year' a quiz_validate() (línia 1452 de /web/sites/all/modules/quiz/quiz.module).

Going a little further with:

dpm($node->quiz_open);dpm($node->quiz_close);

I see:

2014-12-09 00:00
2014-12-09 00:00

Both are strings, so not possible to get these keys.
I am using the last version of drupal with php v. 5.4.36 ...

xjustyx’s picture

I have the same Issue, I had this warning each time I make a new content of type quiz

djdevin’s picture

Status: Needs review » Fixed

Thanks, I was running on PHP 5.3 which doesn't trigger the error.

Fixed!

  • djdevin committed a995c5a on 7.x-5.x authored by aleix
    Issue #2387753 by aleix: errors in function quiz_validate with strings...

  • djdevin committed 7915db8 on 7.x-5.x authored by aleix
    Issue #2387753 by aleix: errors in function quiz_validate with strings...

Status: Fixed » Closed (fixed)

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