Closed (fixed)
Project:
Two-factor Authentication (TFA)
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Nov 2022 at 23:08 UTC
Updated:
11 Jan 2023 at 11:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
acbramley commentedWorking on the fix
Comment #3
acbramley commentedHere's the first part - skipping forms for plugins that aren't enabled. Second part is skipping the actual check for disabled plugins.
Comment #5
acbramley commentedSlight bug here - needed to wrap left side in brackets, fixed in new patch.
Comment #8
acbramley commentedSubdir fix.
Comment #9
jcnventuraIt would be cleaner the move the active plugin check into the getLoginDefinitions code, and add a parameter to those functions that allows to get definitions of all plugins or only the acrive ones.
Ideally, the default would be to get only the active plugins, and the patch will need to change the TFA settings form to use the parameter to get also the inactive plugins.
This will prevent a few more bugs like this from showing up in the future.
Comment #10
acbramley commentedRefactored as per #9 also removed the config check from TfaOverviewForm
Comment #11
jcnventuraComment #12
martijn de witGot same issue where new features in 2.x branch are always enabled.
Patch applies good and works in our situation
+1 RTBC
Comment #15
ankitv18 commentedHi,
Patch#10 is cleanly applied with 2.x-dev branch
I also have opened a MR!20 wrt patch#10, added empty line at the end in tfa.services.yml
+1 RTBC
Comment #16
thatguy commentedThe patch installs cleanly but I get the error below when I go to the module configuration page at /admin/config/people/tfa
"ArgumentCountError: Too few arguments to function Drupal\tfa\TfaPluginManager::__construct(), 3 passed in /app/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 262 and exactly 4 expected in Drupal\tfa\TfaPluginManager->__construct() (line 35 of modules/contrib/tfa/src/TfaPluginManager.php). "
Comment #17
jcnventura@thatguy, you need to clear caches after applying the patch to not have that error. Drupal is still using the previous definition of the tfa.services.yml file.
Comment #18
thatguy commentedYep cache clear fixed it, should already maybe know to try it when something doesn't work :D
Patch seems to fix the issue!
Comment #20
jcnventura