Closed (fixed)
Project:
Drupal 7 to Modern Drupal Module Upgrader
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
11 Feb 2014 at 18:50 UTC
Updated:
11 May 2014 at 20:37 UTC
Jump to comment: Most recent
variable_*() and reference the change record. // Search for a function named modulename_block_info in the .module file.
$filename_info = pathinfo($phpcsFile->getFilename());
if ($filename_info['extension'] == 'module' && $tokens[$stackPtr]['type'] == 'T_FUNCTION' && $tokens[$stackPtr + 2]['content'] == $filename_info['filename'] . '_block_info') {
variable_get('mymodule_variable_name', 'foo');
With:
\Drupal::config('mymodule.setting')->get('variable_name');
mymodule/config/mymodule.settings.yml that sets the default for variable_name to 'foo' by saving as yaml (refer to info the info file conversion).
variable_set().variable_delete(), except just remove it in a hook_uninstall().
Comments
Comment #1
gábor hojtsyCommitted http://drupalcode.org/sandbox/webchick/2193593.git/commitdiff/refs/heads... as a start. Also updated the change notice for variable_* to refer to the state API and the config API also.
Comment #3
xjmComment #4
xjmComment #5
eshta commentedComment #6
webchickestha was STOLEN FROM US, so I'm taking this today. :)
Comment #7
webchickOk, I'm going to call this fixed. YEAH.
Everything in the issue summary is done apart from #2195811: Remove variable_del() calls if they're in a hook_uninstall()., which I spun off a follow-up issue for.
Comment #8
webchickThanks so much for all of your help, eshta! :D
Comment #9
webchickMoving to new project.