The watchdog call in webform.webformconditionals.inc componentVisibility is incorrect and causes an error when you use db log and try to look at the logs.

Easy fix though:

watchdog('webform', 'WebformConditionals::componentVisibility called prior to evaluating a submission.', 'error');

becomes

watchdog('webform', 'WebformConditionals::componentVisibility called prior to evaluating a submission.', NULL, WATCHDOG_ERROR);

will attach a patch shortly

Comments

Tom.W’s picture

StatusFileSize
new811 bytes

patch attached which implements the above suggestion

danchadwick’s picture

You are right that the call is incorrect.

1) Your call isn't quite correct. The third parameter should be array() since the message has not yet been translated.
2) I copied this from somewhere else, which means that I bet there are other calls in the codebase that need checking.
3) Recent commits copied the code above, so there are at least two more problems in the conditionals file.

Thanks for your help.

danchadwick’s picture

Status: Active » Fixed
StatusFileSize
new2.8 KB

Couldn't find the source of the bad copied code. Odd.

I updated the call and fixed the other places in Conditionals.

QUESTION: Why did this happen? This should never happen in normal execution of Webform.

Committed to 7.x-4.x and 8.x.

  • DanChadwick committed 954adad on 8.x-4.x
    Issue #2535066 by asct, DanChadwick: Fixed conditionals watchdog logging...

  • DanChadwick committed 5eaadea on
    Issue #2535066 by asct, DanChadwick: Fixed conditionals watchdog logging...
LeafLin’s picture

Thanks for providing the solution here. It's works nicely.

I believe the error message "WebformConditionals::componentMarkup called prior to evaluating a submission." comes up every time when I navigate between my multipage webform when the page has a markup component.

The markup component can be set to display on "form only" or "viewed submission only" or both. And I guess this is where the error comes from. Although it doesn't seem to cause any other problems..

Any comment is appreciated!!

danchadwick’s picture

Excellent. This is a new issue, which I created.

Rob T’s picture

Thanks for the fix and commit. This was a headscratcher to deal with as the dblog at /admin/reports/dblog was returning only a single message:

Recoverable fatal error: Argument 2 passed to t() must be an array, string given, called in... /modules/dblog/dblog.admin.inc on line 295 and defined in t() (line 1459 of... /includes/bootstrap.inc).

Fortunately I bumped into this thread (https://www.drupal.org/node/1279680), which helped me get my dblog back before leading me here.

I'll post the particulars of what's generating my "WebformConditionals::componentMarkup called prior to evaluating a submission." in the new issue you created, Dan: https://www.drupal.org/node/2542796

Thanks again.

ptocco’s picture

I was having a problem viewing the Log Messages under Reports, then I found a solution on this page. Using the instructions at the top, I got my Log Messages back. I searched with Dreamweaver and found the code in webform/webformconditionals.inc. Anway, today I was continuing to troubleshoot why Webform was not sending emails. The Reports/Log Messages page was working fine until I selected a Filter to search only Webform issues. Then the previous error message came back and all log messages went away:

Recoverable fatal error: Argument 2 passed to t() must be of the type array, string given, called in /var/www/html/modules/dblog/dblog.admin.inc on line 295 and defined in t() (line 1459 of/var/www/html/includes/bootstrap.inc).

So at that point I searched out the code block to check if it's still there:

watchdog('webform', 'WebformConditionals::componentVisibility called prior to evaluating a submission.', NULL, WATCHDOG_ERROR);

And it was, just as I had left it. So now it seems the patch no longer works for me.

On a good note I have fixed Webform's email by installing the SMTP mail system. However I would very much like to be able to see Drupal's Log Messages.

Does anybody have any insights? Much appreciated. Thanks in advance.

danchadwick’s picture

Realize that the patch won't fix existing errant entries in the log. I suggest you use a SQL tool like PhpMyAdmin to delete the webform entries from the watchdog table.

Status: Fixed » Closed (fixed)

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