Event: Node is being viewed.
Action: set data on Node:title and got.

Fatal error: Your exception class uses incorrect types for common properties: 'message' and 'file' need to be a string and 'line' needs to be an integer. in /var/www/d7_dev/sites/all/modules/rules/rules/includes/rules.core.inc on line 623
CommentFileSizeAuthor
#8 translate_in_construct.patch1015 bytesberdir

Comments

fago’s picture

Component: Rules Core » Rules Engine
Status: Active » Postponed (maintainer needs more info)

I just gave it a test and it worked fine for me? Could you provide some more infos? Maybe you have a debug backtrace?

berdir’s picture

Status: Postponed (maintainer needs more info) » Active

Just had the same when doing the following:

1. Fetch entity by id
2. select entity user, continue

3.

Fatal error: Your exception class uses incorrect types for common properties: 'message' and 'file' need to be a string and 'line' needs to be an integer. in /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/includes/rules.core.inc on line 605

Call Stack:
    0.0001     649048   1. {main}() /home/berdir/Projekte/d7/drupal/index.php:0
    0.0351    8285904   2. menu_execute_active_handler() /home/berdir/Projekte/d7/drupal/index.php:22
    0.0353    8290384   3. call_user_func_array() /home/berdir/Projekte/d7/drupal/includes/menu.inc:480
    0.0353    8291256   4. drupal_get_form() /home/berdir/Projekte/d7/drupal/includes/menu.inc:0
    0.0353    8293112   5. drupal_build_form() /home/berdir/Projekte/d7/drupal/includes/form.inc:181
    0.0363    8343592   6. drupal_process_form() /home/berdir/Projekte/d7/drupal/includes/form.inc:341
    0.0380    8520728   7. drupal_validate_form() /home/berdir/Projekte/d7/drupal/includes/form.inc:747
    0.0381    8521640   8. _form_validate() /home/berdir/Projekte/d7/drupal/includes/form.inc:1020
    0.0387    8552432   9. form_execute_handlers() /home/berdir/Projekte/d7/drupal/includes/form.inc:1221
    0.0388    8557008  10. rules_ui_edit_element_validate() /home/berdir/Projekte/d7/drupal/includes/form.inc:1280
    0.0388    8557008  11. RulesPlugin->form_validate() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/ui/ui.forms.inc:303
    0.0388    8557704  12. RulesExtendable->__call() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/includes/rules.core.inc:817
    0.0400    9150992  13. FacesExtendable->__call() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/includes/rules.core.inc:130
    0.0400    9152736  14. call_user_func_array() /home/berdir/Projekte/d7/drupal/sites/all/modules/entity/entity/faces.inc:131
    0.0400    9153352  15. RulesPluginUI->form_validate() /home/berdir/Projekte/d7/drupal/sites/all/modules/entity/entity/faces.inc:0
    0.0489    9278088  16. RulesAbstractPlugin->integrityCheck() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/ui/ui.core.inc:316
    0.0489    9278088  17. RulesPlugin->integrityCheck() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/includes/rules.core.inc:1001
    0.0490    9278224  18. RulesPlugin->checkParameterSettings() /home/berdir/Projekte/d7/drupal/sites/all/modules/rules/rules/includes/rules.core.inc:571

berdir’s picture

Ah, this only happens when xdebug is enabled.

http://xdebug.org/archives/xdebug-dev/1539.html

berdir’s picture

And commenting out the line unset($this->message) fixes it. What is that supposed to do? :)

fago’s picture

hm, I removed the message property so the magic getter is invoked instead as I found no other way to override the message that is output when the exception is printed. In the meantime the drupal error handling got improved, maybe this helps here? Anyway those errors are unacceptable, so feel free to roll a patch to remove that magic.

berdir’s picture

It should be possible to override the __toString() method: http://www.php.net/manual/en/language.exceptions.extending.php

fago’s picture

I tried that but it wasn't picked up (perhaps a bug?). Anyway, it's documented that way, so let's do it that way.

berdir’s picture

StatusFileSize
new1015 bytes

Ah, I guess core doesn't use _toString() but getMessage() :)

Anyway, what about simply setting $this->message in the constructor then? Not a perfect solution, but works...

fago’s picture

Status: Active » Needs review
fago’s picture

Status: Needs review » Fixed

Makes sense. Thanks committed.

Status: Fixed » Closed (fixed)

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

Neil_in_Chicago’s picture

Status: Closed (fixed) » Needs work

I had the same error adding modules to a new install (everything the latest). There are four varying reports of this bug.
See Please add faces to the module dependency list, December 2010.

fago’s picture

Status: Needs work » Closed (fixed)

Then it should suffice to re-open one issue I guess?