Within the tfa.module on line 34 it implements hook_block_access. This is set to disable all access to the standard user_login_block.

The problem is it currently also stops you editing/removing/disabling any existing user login blocks you might already have on your site before enabling the tfa module. It's not a major issue but just means you've got a item in the block listing that can't be removed.

Could this check be altered with something like:

if (\Drupal::config('tfa.settings')->get('enabled') && $block->getPluginId() === 'user_login_block' && $operation != 'update' && $operation != 'delete') {

That should let you remove any existing blocks without causing the block to actually be used anywhere

Issue fork tfa-3058122

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

maseyuk created an issue. See original summary.

msypes’s picture

This can be a significant issue. I had created a login block shortly before adding this module, and realized it was gone/broken.
I'm not sure whether a patch is in order, but in order to fix the issue, I temporary added in the extra code as @maseyuk described, deleted the regular login block and put in the new tfa block. Then I removed the additional code.
Thanks!

marciaibanez’s picture

I'll work on this.

marciaibanez’s picture

Assigned: Unassigned » marciaibanez

marciaibanez’s picture

Assigned: marciaibanez » Unassigned
Status: Active » Needs work

Hi! I made the reported changes in the code, please let me know if I did something wrong or if there's anything else I can do to help. Kindly review it.

marciaibanez’s picture

Status: Needs work » Needs review
Guilherme Rabelo’s picture

Assigned: Unassigned » Guilherme Rabelo

Hi, i will review this.

Guilherme Rabelo’s picture

Assigned: Guilherme Rabelo » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi, the last commit made by @marciaibanez fixed the problem.
I created a block user login and then i enabled the module. I did tests performing the editing and removal of the block and my site did not break. Now a item in the block listing can be removed, edited and disabled. Everything seems to be right.

Moving to RTBC!

jcnventura made their first commit to this issue’s fork.

jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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