Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Old-style Drupal Variables (formerly controlled with variable_set and variable_get) need to be converted to Drupal 8's new configuration system API/storage.
See also: Converting 7.x modules to 8.x, Upgrading 7.x themes to 8.x for further required changes to contrib code in order to work with Drupal 8. The conversion approach below is essential to getting D7 code to work in D8, since variable_set and variable_get will throw fatal errors.