unserialize(): Error, When duplicating site, database caused by userFrameworkResourceURL
Bug error
PHP Notice: unserialize(): Error at offset 60 of 66 bytes in /home/*****/******/wp-content/plugins/civicrm/civicrm/Civi/Core/SettingsBag.php on line 153
Steps to reproduce the bug:
- Have a stable production site running CiviCRM 5.6.1 under WordPress 4.9.8 with url: https://*****.com
- A defined variable for
userFrameworkResourceURL
inwp-content/uploads/civicrm/civicrm.settings.php
and in the database under tablecivicrm_setting
name:userFrameworkResourceURL
- Create a duplicate/staging site (including new duplicated database) with a subdomain/url dev.*****.com and update
civicrm.settings.php
vars includinguserFrameworkResourceURL
- Run upgrade database. everything is fine
- On any page load
Receive error unserialize(): Error at offset 60 of 66 bytes
Workaround:
- Delete the "value" from
userFrameworkResourceURL
in the database.
SELECT * FROM `civicrm_setting` WHERE `name` = 'userFrameworkResourceURL'
- Go to
Settings - Resource URLs
and hit save - Proper serialized value gets written in the database
Note: if userFrameworkResourceURL
is defined in civicrm.settings.php
(which is the default at least in WordPress install)
Saving through the web-end doesn't overwrite the database hence the "workaround"