I experienced problem with executing drush ctex command when there is any rules with bad integrity. The way for me to correct it was using Rules > Settings > Advanced > Recheck Inegrity. Then I needed to delete bad rule (otherwise there might be a way to correct the issue).

Error message in my case was:

PHP Fatal error:  RulesContainerPlugin::exportChildren(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "RulesConditionalSwitch" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition  in /var/www/site/docroot/sites/all/modules/rules/includes/rules.core.inc on line 2331
Drush command terminated abnormally due to an unrecoverable error.

Perhaps it would be good to add mention about this potential problem to readme, as it isn't obvious (this Drush extension isn't dependent on Rules.

Comments

milos.kroulik’s picture

Title: Bad rule can make drush ctex command fail » Invalid rule can cause failure of rule exporting
Project: Drush CTools Export Bonus » Rules

This failure is happening also when exporting with Features, so I think, that it makes sense to move this issue to Rules itself.

TR’s picture

Status: Active » Closed (outdated)

If you continue to have a problem with this in the current version of Rules please open a new issue.