0

I'm trying to deploy a development Drupal instance to a test environment, but something is going wrong with Rules.

I copied the entire site's filesystem, dumped the database with mysqldump, imported the dump file to the test database server, and edited the test instance's settings.php.

I can log into the new test site, but the site fails if I try to rebuild caches. Permanently.

If I go to Admin->Configuration->Workflow-Rules, the page is broken. I see the following warnings and errors:

Notice: unserialize(): Error at offset 6574 of 7668 bytes in unserialize() (line 261 of [site location]/sites/all/modules/entity/includes/entity.controller.inc).

Notice: unserialize(): Error at offset 6574 of 7668 bytes in unserialize() (line 261 of [site location]/sites/all/modules/entity/includes/entity.controller.inc). => 

Warning: Creating default object from empty value in attachLoad() (line 57 of [site location]/sites/all/modules/rules/includes/rules.core.inc).

Warning: Creating default object from empty value in attachLoad() (line 57 of [site location]/sites/all/modules/rules/includes/rules.core.inc). => 

Error: Call to undefined method stdClass::buildContent() in RulesUIController->overviewTableRow() (line 260 of [site location]/sites/all/modules/rules/ui/ui.controller.inc).

I also disabled the rules on the dev site before dumping the database. Same situation.

And now the site is unusable. Am I missing something that needs to be done to deploy a site with rules? Is there some way to repair a broken rules system?

3
  • use FEATURES, this will generate a module, export with your code this new module, enable it in test, done. – pinueve Aug 5 '20 at 23:48
  • Serialization errors like that are generally due to problems with PHP's serialization. Serialization was changed in PHP 7.3, so one possibility is that you're trying to deploy on a system with a different version of PHP than your test environment. But that's not the only way PHP serialization can break, because in PHP things aren't guaranteed to serialize/unserialize the same way on different systems. Features is one way to avoid this, another is to export your Rules then import it on your other server, that way you're not trying to copy a serialized object from one database to another – anonymous Aug 11 '20 at 23:33
  • Some more discussion and possible work-arounds can be found in the Rules issue queue, for example drupal.org/project/rules/issues/3042464 – anonymous Aug 11 '20 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.