This is part of #1775842: [meta] Convert all variables to state and/or config systems
+++ b/core/modules/user/config/user.settings.ymlundefined @@ -12,3 +12,6 @@ notify: +block_max_list_count: '10' +block_seconds_online: '900' +block_whois_new_count: '5' diff --git a/core/modules/user/user.module b/core/modules/user/user.module
Group this in a block key. Like block.max_list_count and block.seconds_online
The patch doesn't work on root system of drupal.
I checked out a new branch and apply the following line in command shell:
'git apply -v user_block_cmi.patch'
dlamp@dlamp-vm-server:~/workspace/drupal/drupal-8x-dev/htdocs$ git apply -v user_block_cmi.patch Checking patch core/modules/user/config/user.settings.yml... warning: core/modules/user/config/user.settings.yml has type 100755, expected 100644 error: while searching for: register_pending_approval: '1' register: visitors signatures: '0'
error: patch failed: core/modules/user/config/user.settings.yml:12 error: core/modules/user/config/user.settings.yml: patch does not apply Checking patch core/modules/user/user.module... Hunk #1 succeeded at 722 (offset -41 lines). Hunk #2 succeeded at 740 (offset -41 lines). Hunk #3 succeeded at 805 (offset -41 lines). Hunk #4 succeeded at 821 (offset -41 lines). Hunk #5 succeeded at 835 (offset -41 lines).
but it doesn't work and the patch was not applied.
I make change manually from patch above and create new one.
It is fixed and needs review.
Needs an upgrade path. See http://drupal.org/node/1667896#upgrade
Tagging accordingly.
I have add a upgrade path and new yml file for separate the user_block_* settings.
This patch works fine for me. Variables are stored in config and the blocks work as they did before.
+ $count = config('user.block')->get('whois_new_count'); + $interval = REQUEST_TIME - config('user.block')->get('seconds_online'); + $max_users = config('user.block')->get('max_list_count');
Minor nitpick, these should probably use a common $config = config('user.block'); as in user_block_save().
$config = config('user.block');
Also, do we need tests for the upgrade path?
Added the minor nitpick. ;-)
The new patch works as well as #9. The points of #12 are fixed.
I think that tests are not needed, because the functionality doesn't change.
Reverted the changed file permissions from the patch in #13. I found one variable_get in the test and converted this to cmi.
Ooops. Uploaded the wrong patch.
The last submitted patch, user-convert_user_block_variables_to_cmi-1823348-17.patch, failed testing.
#17: user-convert_user_block_variables_to_cmi-1823348-17.patch queued for re-testing.
Hi @webflo thanks for reviewing and changing the test case.
done!
Committed/pushed to 8.x, thanks!
fyi, this patch was kinda pointless, as this is all getting refactored: #1535868: Convert all blocks into plugins
oh well, no big.
Automatically closed -- issue fixed for 2 weeks with no activity.
Comments
Comment #1
Albert Volkman CreditAttribution: Albert Volkman commentedComment #2
aspilicious CreditAttribution: aspilicious commentedGroup this in a block key. Like block.max_list_count and block.seconds_online
Comment #3
asaal CreditAttribution: asaal commentedComment #4
asaal CreditAttribution: asaal commentedThe patch doesn't work on root system of drupal.
I checked out a new branch and apply the following line in command shell:
'git apply -v user_block_cmi.patch'
dlamp@dlamp-vm-server:~/workspace/drupal/drupal-8x-dev/htdocs$ git apply -v user_block_cmi.patch
Checking patch core/modules/user/config/user.settings.yml...
warning: core/modules/user/config/user.settings.yml has type 100755, expected 100644
error: while searching for:
register_pending_approval: '1'
register: visitors
signatures: '0'
error: patch failed: core/modules/user/config/user.settings.yml:12
error: core/modules/user/config/user.settings.yml: patch does not apply
Checking patch core/modules/user/user.module...
Hunk #1 succeeded at 722 (offset -41 lines).
Hunk #2 succeeded at 740 (offset -41 lines).
Hunk #3 succeeded at 805 (offset -41 lines).
Hunk #4 succeeded at 821 (offset -41 lines).
Hunk #5 succeeded at 835 (offset -41 lines).
but it doesn't work and the patch was not applied.
I make change manually from patch above and create new one.
Comment #5
asaal CreditAttribution: asaal commentedIt is fixed and needs review.
Comment #6
asaal CreditAttribution: asaal commentedComment #7
penyaskitoNeeds an upgrade path. See http://drupal.org/node/1667896#upgrade
Comment #8
penyaskitoTagging accordingly.
Comment #9
asaal CreditAttribution: asaal commentedI have add a upgrade path and new yml file for separate the user_block_* settings.
Comment #10
Hanspolo CreditAttribution: Hanspolo commentedThis patch works fine for me.
Variables are stored in config and the blocks work as they did before.
Comment #11
Hanspolo CreditAttribution: Hanspolo commentedThis patch works fine for me.
Variables are stored in config and the blocks work as they did before.
Comment #12
longwaveMinor nitpick, these should probably use a common
$config = config('user.block');
as in user_block_save().Also, do we need tests for the upgrade path?
Comment #13
asaal CreditAttribution: asaal commentedAdded the minor nitpick. ;-)
Comment #14
Hanspolo CreditAttribution: Hanspolo commentedThe new patch works as well as #9.
The points of #12 are fixed.
I think that tests are not needed, because the functionality doesn't change.
Comment #15
webflo CreditAttribution: webflo commentedReverted the changed file permissions from the patch in #13. I found one variable_get in the test and converted this to cmi.
Comment #16
webflo CreditAttribution: webflo commentedOoops. Uploaded the wrong patch.
Comment #17
webflo CreditAttribution: webflo commentedComment #19
webflo CreditAttribution: webflo commented#17: user-convert_user_block_variables_to_cmi-1823348-17.patch queued for re-testing.
Comment #21
webflo CreditAttribution: webflo commented#17: user-convert_user_block_variables_to_cmi-1823348-17.patch queued for re-testing.
Comment #22
asaal CreditAttribution: asaal commentedHi @webflo thanks for reviewing and changing the test case.
Comment #23
aspilicious CreditAttribution: aspilicious commenteddone!
Comment #24
catchCommitted/pushed to 8.x, thanks!
Comment #25
sdboyer CreditAttribution: sdboyer commentedfyi, this patch was kinda pointless, as this is all getting refactored: #1535868: Convert all blocks into plugins
oh well, no big.