We want to get rid of the variables system, and in order to do that we need to deal with all the variables in core. Most of these will be converted to either the new configuration system (much of this being tracked in #1696224: Remove system_settings_form()) and most of what is left will be moved to the new state system one it lands (#1175054: Add a storage (API) for persistent non-configuration state). This issue is here to track the conversion of these variables.

The good news: As of the creation of this issue, CMI had converted 81 variables.
The bad news: As of the creation of this issue, there are 232 variables left. 52 of these have issues created to deal with them and 180 remain.

This list was originally generated by cosmicdreams in a google doc. I have taken that list, removed the variables converted by CMI as well as some invalid ones, and exported it to HTML with some minimal cleanup. There is probably still some garbage here, but I think it is a useful start.

Related issues:
#1735118: Convert Field API to CMI
#1712258: Simplify image toolkit form logic, removing unneeded checks.
#1751348: Convert locale settings to configuration system
#1175054: Add a storage (API) for persistent non-configuration state
#1571632: Convert regional settings to configuration system
#1714462: Convert language negotiation settings to configuration system
#1793102: Convert reverse proxy settings to new configuration system
#1802750: [Meta] Convert configurable data to ConfigEntity system

How tos

Todo (4)

Variable name File found in Issue Notes
language_default bootstrap.inc #2108599: Convert language_default to CMI
language_negotiation_ . $type language.inc #2102477: Convert remainder of language negotiation settings to configuration system
language_negotiation_methods_weight_$type language.negotiation.inc #2102477: Convert remainder of language negotiation settings to configuration system
node_rank_ . $rank various #2042807: Convert search plugins to use a ConfigEntity and a PluginBag / #1831632: Convert node_rank_ $rank variables to use configuration system

Completed (140)

Variable name File found in Issue Notes
my_module_menus menu.api.php #2108679: API documentation: Convert my_module_menus examples in menu.api.php to CMI
language_negotiation_ . $type language.inc #1714462: Convert language negotiation settings to configuration system
language_negotiation_methods_weight_$type language.negotiation.inc #1714462: Convert language negotiation settings to configuration system
instal_time system.module #2137217: Remove install_time variable get usage
file_public_path file.inc #2137231: Remove file_public_path variable get usage
menu_options_* menu.module #2102521: Finish converting menu.module to CMI
menu_parent_* menu.module #2102521: Finish converting menu.module to CMI
various various #2109065: Remove variable_get and variable_set calls from API documentation
comment_* comment.module #731724: Convert comment settings into a field to make them work with CMI and non-node entities
field_bundle_settings_[entity_type]__[bundle] field.module #1953528: Store 'per-bundle view mode settings' in CMI, get rid of field_bundle_settings() & its variable
anonymous ContentTranslationController.php #2102503: Convert ContentTranslationController to CMI
cache language.inc #2101661: Update cache checking logic in core/includes/langauge.inc to use config system
css_js_query_string common.inc #1798738: Move css_js_query_string to state system
cache_backends bootstrap.inc #1605414: Move cache backend configuration out of $conf
diff_context_lines_* DiffEngine.php #2102499: Convert DiffEngine to settings
drupal_get_profile() doc block common.inc #2112261: Fix documentation for drupal_get_profile()
drupal_js_version_query_string common.inc #1824848: Remove drupal_js_version_string variable (instead of converting it)
session_write_interval session.inc #1969846: Convert session_write_interval to settings
field_storage_default #1942346: Convert Field API variables to CMI
install_current_batch install.core.inc #1798732: Convert install_task, install_time and install_current_batch to use the state system
install_task shortcut.install #1798732: Convert install_task, install_time and install_current_batch to use the state system
install_time system.module #1798732: Convert install_task, install_time and install_current_batch to use the state system
language_content_type_ . % (locale_uninstall) local.install #1827038: Remove stale references to language_content_type variable
locale_translate_english locale.module #1998088: Convert locale_translate_english variable to CMI
maintenance_theme theme.maintenance.inc #1829170: Convert the Maintenance Theme variable to settings
mymodule_shortcut_admin_default_set shortcut.api.php #1975150: Remove variable_get from mymodule_shortcut_admin_default_set in the shortcut.api.php
theme_$theme_settings theme.inc #1712250: Convert theme settings to configuration system / #1830978: Convert theme setting variables in system module to CMI
theme_settings theme.inc #1712250: Convert theme settings to configuration system / #1830978: Convert theme setting variables in system module to CMI
menu_default_active_menus menu.inc / menu.module #1829308: Convert variables in menu.inc to config and state / #2106097: Finish converting menu_default_active_menus to CMI
node_test_change_view_mode node_test.module #1937212: Change node test variables 'node_test_change_view_mode' and 'node_access_test_secret_catalan' to the state system
node_access_test_secret_catalan node_access_test.module #1937212: Change node test variables 'node_test_change_view_mode' and 'node_access_test_secret_catalan' to the state system
drupal_css_cache_files ColorTest #1937270: Change drupal_css_cache_files into state.
https common.inc #1798832: Convert https to $settings
image_toolkit system.admin.inc #1937196: Convert image_toolkit to cmi
image_jpeg_quality image.gd.inc #1937140: Convert image_jpeg_quality to cmi
site_name user\lib\Drupal\user\Tests\UserPasswordResetTest.php #1932596: Change site_name into config in userpasswordreset.test and formtest
path_alias_whitelist path.inc #1798884: Convert path_alias_whitelist to state system
locale_translation_plurals gettext.inc #1751348: Convert locale settings to configuration system
locale_custom_strings_* settings.php #1975490: Convert locale_custom_strings_* to settings
color_ . $theme . _files color.module #1804380: convert color variables to config/state
color_ . $theme . _palette color.module #1804380: convert color variables to config/state
color_ . $theme_key . _logo color.module #1804380: convert color variables to config/state
color_ . $theme_key . _stylesheets color.module #1804380: convert color variables to config/state
file_chmod_directory file.inc #1496480: Convert file system settings to the new configuration system
file_chmod_file file.inc #1496480: Convert file system settings to the new configuration system
file_default_scheme file.inc #1496480: Convert file system settings to the new configuration system
file_private_path file.inc #1496480: Convert file system settings to the new configuration system
file_temporary_path file.inc #1496480: Convert file system settings to the new configuration system
autoloader_mode bootstrap.inc #1814086: Convert autoloader_mode in drupal_classloader to its own global
404_fast_html bootstrap.inc #1778478: Convert fast_404 to CMI
404_fast_paths bootstrap.inc #1778478: Convert fast_404 to CMI
404_fast_paths_exclude bootstrap.inc #1778478: Convert fast_404 to CMI
simpletest_bootstrap_variable_test bootstrap.test Do not convert
actions_max_stack actions.inc #1788084: Convert actions variable(s) to CMI - add upgrade path
admin_compact_mode system.module #1824762: Convert admin_compact_mode to CMI
admin_theme theme.inc #1798872: Convert admin_theme to CMI
allow_authorize_operations authorize.php #1804346: Convert authorize variables to config system.
allow_authorize_operations update.module #1804346: Convert authorize variables to config system.
authorize_filetransfer_connection_settings_ . $backend authorize.inc #1804346: Convert authorize variables to config system.
authorize_filetransfer_default authorize.inc #1804346: Convert authorize variables to config system.
ban_ips ban.module #1479466: Convert IP address blocking to config system (setting was removed)
batch_test_stack batch_test.module #1843410: Change variable batch_test_stack to the state system.
block_test_* block_test.module #1843420: Change block test variables - block_test_cache and block_test_content to state system
configurable_timezone system.admin.inc #1571632: Convert regional settings to configuration system
common_test_cron system.test #1790920: Move cron_last, node_cron_last and common_test_cron to state system
cron_last system.admin.inc #1790920: Move cron_last, node_cron_last and common_test_cron to state system
css_gzip_compression common.inc #1824778: Convert css_gzip_compression and js_gzip_compression variables to CMI system
default_nodes_main #1824834: Covert default_nodes_main variable to CMI system
dependency_test module_test.module #1843452: Change dependency_test variable to state system.
drupal_private_key common.inc #1798734: Convert drupal_private_key to the configuration system.
drupal_js_cache_files common.inc #1798724: Convert drupal_js_cache_files to State system
drupal_stale_file_threshold common.inc #1824854: Convert variable drupal_stale_file_threshold to CMI system
drupal_test_email_collector VariableLog.php #1824768: Convert drupal_test_email_collector variable to CMI system
drupal_weight_select_max form.inc #1824898: Convert drupal_weight_select_max variable to CMI system
entity_cache_test entity.test #1843462: Change entity_test variables - entity_test_translation, entity_cache_test and entity_cache_test_label to the state system.
entity_cache_test_label entity_cache_test_dependency.module #1843462: Change entity_test variables - entity_test_translation, entity_cache_test and entity_cache_test_label to the state system.
entity_form_langcode some tests #1932806: Change entity_form_langcode to the state system.
entity_test_translation entity_test.module #1843462: Change entity_test variables - entity_test_translation, entity_cache_test and entity_cache_test_label to the state system.
error_level error.inc #1798756: Finish conversion of error_level to CMI
field_purge_batch_size field.module #1798782: Convert field_purge_batch_size to CMI
field_test_* field_test.entity.inc #1843476: Change field_test variables to state system.
file_description_length file.field.inc #1804394: convert file.module variables to CMI
file_description_type file.field.inc #1804394: convert file.module variables to CMI
file_icon_directory file.field.inc #1804394: convert file.module variables to CMI
file_test_* file_test.module #1843486: Change file_test variables to state system.
filter_allowed_protocols common.inc #1799440: Convert Filter variables to Configuration System
filter_default_format #1799440: Convert Filter variables to Configuration System
filter_fallback_format filter.module #1799440: Convert Filter variables to Configuration System
front_page_output system_test.module #1848058: Change system test variables to the state system
image_module_test_file_download image_module_text.module #1824926: Convert image_module_test_file_download variable to CMI system
image_style_preview_image image.admin.inc #1828924: Convert the Image Style Preview Image to CMI
image_test_results image_test.module #1848058: Change system test variables to the state system
install_profile common.inc #1827112: Convert 'install_profile' variable to Settings
install_profile_modules install.core.inc #1830148: Convert 'install_profile_modules' variable to state
javascript_parsed locale.module #1798796: Convert javascript_parsed variable to use state system
js_gzip_compression common.inc #1824778: Convert css_gzip_compression and js_gzip_compression variables to CMI system
language_count bootstrap.inc #1856976: Convert language_count to the state system.
language_test_* language_test.module #1843948: Change language test variables to the state system.
lock_backend lock.inc #1825450: Use lock service in lock()
mac_key OpenIDFunctionalTest.php #1826190: Remove dead mac_key variable from open_id_test module
mail_line_endings PhpMail.php #1821420: Convert mail variables to cmi
mail_system mail.inc #1821420: Convert mail variables to cmi
maximum_replication_lag database.inc #1833516: Add a new top-level global for settings.php - move things out of $conf
menu_default_node_menu views\lib\Drupal\views\Plugin\views\display\Page.php #1975114: Views references menu_default_node_menu variable which doesn't exist anywhere else
menu_inc common.inc #1833516: Add a new top-level global for settings.php - move things out of $conf
menu_expanded menu.inc #1829308: Convert variables in menu.inc to config and state
menu_override_parent_selector book.module #1830936: Convert the 'menu_override_parent_selector' variable to CMI
menu_test_* menu.test #1843954: Change menu test variables to the state system.
node_access_needs_rebuild node.module #1798804: Convert node_access_needs_rebuild to state system
node_access_test_private node_access_test module #1814402: Convert 'node_access_test_private' variable to state() system
node_admin_theme node.module #2066145: Convert node_admin_theme to the configuration system
node_cron_comments_scale comment.module #1831486: Convert comment variables to config/state
node_cron_last #1790920: Move cron_last, node_cron_last and common_test_cron to state system
node_cron_views_scale statistics.module #1831522: Convert statistics variables to config/state
node_options_ . $type content_types.inc #111715: Convert node/content types into configuration
node_preview_ . $type content_types.inc #111715: Convert node/content types into configuration
node_recent_block_count node.module #1798852: Convert node_recent_block_count to use state system (unnecessary - will be part of Scotch initiative)
node_submitted_ . $type content_types.inc #111715: Convert node/content types into configuration
node_test_node_access_all_uid #1798868: Convert node_test_node_access_all_uid to state system
node_type_language_ . $type content_types.inc #1739928: Generalize language configuration on content types to apply to terms and other entities
openid_test_* openid_test.module #1848054: Change openid test variables to the state system.
omit_vary_cookie bootstrap.inc #1831076: Convert omit_vary_cookie to cmi
path_inc common.inc #1269742: Make path lookup code into a pluggable class
password_count_log2 password.inc #1463624: Move password.inc into DIC
password_inc system.test #1463624: Move password.inc into DIC
path_test_results path.test #1848058: Change system test variables to the state system
sample_search_force_keywords search.api.inc #1496510: Convert search settings to configuration system
session_inc bootstrap.inc #1833516: Add a new top-level global for settings.php - move things out of $conf
statistics_day_timestamp statistics.module #1831522: Convert statistics variables to config/state
stream_public_path DummyReadOnlyStreamWrapper.php (test) #2109833: Finish converting stream_public_path to CMI
syslog_facility syslog.module #1804408: convert syslog variables to config/state system.
syslog_format syslog.module #1804408: convert syslog variables to config/state system.
syslog_identity syslog.module #1804408: convert syslog variables to config/state system.
taxonomy_ . $vid . _synonyms taxonomy.module #1831540: Rewrite examples in taxonomy.api.php and remove references to synonyms
taxonomy_maintain_index_table taxonomy.module #1799218: Convert taxonomy_override_selector and taxonomy_terms_per_page_admin variables to use configuration system
taxonomy_override_selector taxonomy.admin.inc #1799218: Convert taxonomy_override_selector and taxonomy_terms_per_page_admin variables to use configuration system
taxonomy_terms_per_page_admin taxonomy.admin.inc #1799218: Convert taxonomy_override_selector and taxonomy_terms_per_page_admin variables to use configuration system
teaser_length text.module #1798880: Convert teaser_length to use configuration system
test_module_disable_order module_test.test #1872834: Convert test_module_disable_order and test_module_uninstall_order to the new configuration system
test_module_enable_order system.test #1848058: Change system test variables to the state system
test_module_uninstall_order module_test.test #1872834: Convert test_module_disable_order and test_module_uninstall_order to the new configuration system
test_verbose_module_hooks system_test.module #1848058: Change system test variables to the state system
theme_default theme.inc #1829224: Convert the 'theme_default' variable to CMI
theme_link common.inc #1824920: Convert variable 'theme_link' to config system
tracker_index_nid Tracker module #1813184: Convert variable 'tracker_index_nid' to state system
translation_language_type translation.pages.inc #1830848: Convert the 'translation_language_type' variable to CMI
node_type_language_translation_enabled_ . $type translation.module #1952062: Remove legacy translation module in favor of content translation
update_d8_requirements update.inc #1831822: convert update variables to state
update_last_check update.manager.inc #1810880: Convert update_last_check and update_last_email_notification variables to CMI system
update_last_email_notification update.fetch.inc #1810880: Convert update_last_check and update_last_email_notification variables to CMI system
user_block_max_list_count user.module #1823348: Convert user_block variables to cmi
user_block_seconds_online user.module #1823348: Convert user_block variables to cmi
user_block_whois_new_count user.module #1823348: Convert user_block variables to cmi
user_cancel_method user.pages.inc #1807266: Convert user_cancel_method variable to CMI system
user_mail_ . $key user.module #1757566: Convert user account e-mail templates to configuration system
user_password_reset_timeout user.pages.inc #1814558: Convert user_password_reset_timeout variable to use config system
user_picture_default user.admin.inc #1292470: Convert user pictures to Image Field
user_picture_dimensions user.admin.inc #1292470: Convert user pictures to Image Field
user_picture_file_size user.admin.inc #1292470: Convert user pictures to Image Field
user_picture_guidelines user.admin.inc #1292470: Convert user pictures to Image Field
user_picture_path user.admin.inc #1292470: Convert user pictures to Image Field
user_picture_style user.admin.inc #1292470: Convert user pictures to Image Field
user_pictures system.admin.inc #1292470: Convert user pictures to Image Field
xmlrpc_test_xmlrpc_alter xmlrpc_test.module #1848066: Change variable xmlrpc_test_xmlrpc_alter to the state system.
xri_proxy_resolver openid.module #1824712: Convert xri_proxy_resolver variable to CMI config system
queue_class_ . $name common.inc #1814496: Make queue a container service
queue_default_class common.inc #1814496: Make queue a container service
queue_default_reliable_class common.inc #1814496: Make queue a container service
register_pending_approval_admin user.module #1804926: Convert register_pending_approval_admin email to config system and provide the ability to configure it in UI.
CommentFileSizeAuthor
#19 die.patch4.71 KBcatch
#1 my_tombstone.jpg37.25 KBgdd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gdd’s picture

FileSize
37.25 KB
gdd’s picture

Priority: Normal » Critical
sun’s picture

Fixing the utterly ugly styling. (by implanting some sensible CSS)

Mile23’s picture

What's the best place to read to find out how to do this conversion?

gdd’s picture

For the moment, we're a little blocked on #1175054: Add a storage (API) for persistent non-configuration state. All the obvious variables tied to configuration have issues already, and the issues that remain are pretty complicated. However, once the state system lands, we will need a plan of attack. For config, we split the issues out based on the forms the variables appeared in. I'm not sure what the best way to split this one out is. By the file the variables appear in? Anyone have other ideas?

HongPong’s picture

@mile23 here is a pretty good guide for how to do this: http://drupal.org/node/1667896 . Also this is very helpful: http://heyrocker.com/how-use-drupal-8-configuration-system

cosmicdreams’s picture

Oh we have an issue for this awesome!

gdd’s picture

@Hongpong note that most of the remaining variables to be converted are not configuration at all, but will be moving to the new state system (#1175054: Add a storage (API) for persistent non-configuration state)

gdd’s picture

I cleaned this list up a bit, it now lists all the issues covering variable conversion at the top, and the table is just the variables that remain unclaimed. This makes a little more sense since these issues all cover a variety of different variables.

gdd’s picture

I cleaned this list up a bit, it now lists all the issues covering variable conversion at the top, and the table is just the variables that remain unclaimed. This makes a little more sense since these issues all cover a variety of different variables.

webchick’s picture

Please don't forget to update settings.php $conf override examples as you go through: #1716920: $conf override example documentation needs updating

Mile23’s picture

@HongPong thanks!

Maybe someone with superpowers can add those links to the original issue.

webchick’s picture

Also created #1785338: Create a change notice containing table of old vs. new variable names. Maybe this table could be created as we go to make it easier?

gdd’s picture

Well we already converted a bunch so it can already get started.

catch’s picture

Hmm we have

http://api.drupal.org/api/drupal/core!includes!update.inc/function/update_variables_to_config/8

What if we required the variable map to be stored somewhere parseable (like make it a class?), then it could be used to generate lists, for coder module etc.

xjm’s picture

We filed #1802750: [Meta] Convert configurable data to ConfigEntity system as a meta for data that should use the ConfigEntity system. I updated the summary.

See #1668820: Concept, base class, and interface for Configurables (e.g., node types, image styles, vocabularies, views, etc) for an explanation of what Configurables are (as compared to plain configuration or state).

gdd’s picture

A little status update on this progress. There are currently 288 calls to variable_get() left in core. Of these...

51 are for 'theme_default'
50 are for file_*
30 are for locale_*

The rest are scattered around, although quite a few of those are destined to be fixed around #1833516: Add a new top-level global for settings.php - move things out of $conf and those should be reasonably easy.

So we're moving along really well. Keep up the great work everyone!

catch’s picture

Status: Active » Needs work
FileSize
4.71 KB

Just getting ready.

xjm’s picture

From #1735118-196: Convert Field API to CMI: It looks like the variable field_storage_default will need its own conversion. I'll add it to the summary.

ParisLiakos’s picture

session_write_interval is still there and i would rather convert it separately from the session patch. It should be in settings right?

ParisLiakos’s picture

Issue summary: View changes

Moving https to completed, updating counts

moshe weitzman’s picture

Looks to me like we have slowed down here. Would be good to rally and get closer to completion.

catch’s picture

@Moshe: I just RTBC-ed the last easy one, everything else has complications.

aspilicious’s picture

Issue summary: View changes

Updated

webchick’s picture

AFAIK the removal of variable_*() prior to 8.0 is an approved API change that pre-dates API freeze. Tagging as such.

yched’s picture

Added field.module's field_bundle_settings_[entity_type]__[bundle] - #1953528: Store 'per-bundle view mode settings' in CMI, get rid of field_bundle_settings() & its variable in the TODO section in the OP, was missing so far :-/ (possibly on the assumption that it would be covered in #1735118: Convert Field API to CMI - but there were many different things in there...)

dlu’s picture

Issue tags: -Approved API change

Moved to configuration system per #2050763-16: Refine "base system" component (notes on refactoring of "base system" category here: https://docs.google.com/a/acquia.com/spreadsheet/ccc?key=0AusehVccVSq2dF...).

webchick’s picture

Component: base system » configuration system

Let's try that again. Oh, d.o.

mtift’s picture

Issue tags: +sprint, +Approved API change

Tagging

aspilicious’s picture

Issue summary: View changes

Moved more fixed issues

catch’s picture

We're down to less than a dozen issues, some of which are one-liners. I've gone ahead and bumped some of the child issues individually to critical.

xjm’s picture

Issue summary: View changes
Issue tags: -Variable tombstone +beta blocker
xjm’s picture

Issue summary: View changes
xjm’s picture

Title: [meta] Convert all variables to state and/or config systems » [meta] Convert all variables to state and/or config systems and remove variable_*()

Retitling to reflect what the actual patch for this issue will do.

aspilicious’s picture

Issue summary: View changes
aspilicious’s picture

Issue summary: View changes
aspilicious’s picture

Issue summary: View changes
sun’s picture

ianthomas_uk’s picture

Issue summary: View changes

Updated todo list, including removing #1856766: Convert file_public_path to the new settings system (make it not configurable via UI or YAML) as that variable has already been converted to settings.

sun’s picture

Title: [meta] Convert all variables to state and/or config systems and remove variable_*() » [meta] Convert all variables to state and/or config systems
Status: Needs work » Active
catch’s picture

Status: Active » Closed (duplicate)

Since the last two language issues are already critical, and #2167109: Remove Variable subsystem is open, I don't think this meta issue is very useful any more. Marking as duplicate.

xjm’s picture