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.
This is a sub-task of http://drupal.org/node/1775842 Convert all variables to state and/or config systems.
Comment | File | Size | Author |
---|---|---|---|
#14 | 1826190-mac_key-cmi-14.patch | 3.02 KB | alexpott |
#11 | 1826190-mac_key-cmi-11.patch | 2.12 KB | vijaycs85 |
#8 | 1826190-mac_key-cmi-7.patch | 2.64 KB | Lukas von Blarer |
#6 | 1826190-mac_key-cmi-6.patch | 2.29 KB | Lukas von Blarer |
#3 | 1826190-mac_key-cmi-2.patch | 2.09 KB | vijaycs85 |
Comments
Comment #1
vijaycs85Comment #2
alexpottYou need to set the mac_key in openid_test.install
There's no point doing the conditional here... should just be
$association->mac_key = state()->get('mac_key');
Comment #3
vijaycs85Thanks for your comment. I don't see "openid_test_mac_key" that defined in openid_test.install used anywhere. So replacing it with "mac_key".
Comment #4
alexpottAlso the state key should be namespaced... so it should be
openid_test.mac_key
Comment #5
alexpottIt's interesting that the tests works without a mac_key... this should be investigated too.
Comment #6
Lukas von BlarerI replaced the state key.
What should I do to investigate the testing issue?
Comment #8
Lukas von BlarerI had the wrong Git config...
Comment #10
Lukas von BlarerThe tests seem to be broken. Initially there were thwo variable names
mac_key
andopenid_test_mac_key
. And we are converting both of them toopenid_test.mac_key
. Is this correct? Also, We are not converting a set. This can't have the correct result in the tests.Comment #11
vijaycs85Keeping existing openid_test_mac_key as it is.
Comment #12
vijaycs85Lukas you are right. Its not failing if I don't change the
openid_test_mac_key
I don't find any other instant of this variable anywhere other than install. Not sure why it is causing issue. But this is good to go with what we have at #11.Comment #13
Cameron Tod CreditAttribution: Cameron Tod commentedLooks good to me!
Comment #14
alexpottLets not perpetuate this bug...
+++ b/core/modules/openid/tests/openid_test.installundefined
@@ -13,5 +13,5 @@ function openid_test_install() {
// Generate a MAC key (Message Authentication Code) used for signing messages.
// The variable is base64-encoded, because variables cannot contain non-UTF-8
// data.
- variable_set('openid_test_mac_key', base64_encode(_openid_get_bytes(20)));
+ state()->set('openid_test_mac_key', base64_encode(_openid_get_bytes(20)));
The .install file and variable/state key is completely unnecessary as it is in never actually used!
How about this patch...
Comment #15
vijaycs85+1 to Alex patch... we don't use it anyway.
Comment #16
Cameron Tod CreditAttribution: Cameron Tod commentedTaking code out is always better than putting code in :)
Comment #17
catchHeh nice find, let's kill it. Committed/pushed to 8.x.
Comment #19
vijaycs85