We to to deprecate the variable_get, variable_del, variable_set functions as of Drupal 8.0.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mtift’s picture

Status: Active » Needs review
FileSize
1.22 KB

Patch is attached.

mtift’s picture

Fixed formatting

xjm’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Configuration system

Looks good to me. Thanks @mtift!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/includes/bootstrap.incundefined
@@ -934,8 +938,10 @@ function variable_set($name, $value) {
+ * @see \Drupal\Core\Config::delete()

Actually this one is interesting because the would delete the entire config object (ie. file). I think I more comparable function is Config::clear()

mtift’s picture

Status: Needs work » Needs review
FileSize
1.35 KB

Revised patch attached

xjm’s picture

Issue tags: +Needs followup

Yeah. I think we should at a minimum rename those methods. As @alexpott pointed out it's also questionable for the current delete() to be on the object at all, but that's another can of worms. And all of that is out of scope here, so tagging for a followup.

xjm’s picture

Status: Needs review » Reviewed & tested by the community
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed this, but we should probably have included the state/settings systems in the comments as well, not all variable_* calls should be converted to config. We're removing this as soon as we've converted core anyway though, so doesn't matter too much.

Automatically closed -- issue fixed for 2 weeks with no activity.