Closed (fixed)
Project:
Role Test Accounts
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2020 at 12:48 UTC
Updated:
28 Aug 2020 at 14:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Guillaume.Klomp commentedHere is the fix.
Comment #3
idebr commentedThe Drupal uses 'Active' and 'Blocked' for the user status. I suggest we use the interface text 'Block account after period of inactivity'
The patch was created from a release, so it includes package information. Instructions on how to create a patch without this information are available at https://www.drupal.org/node/707484
This hook description does not match the code.
This new option can be in the optional schema for new installations, but should be 0 for existing installations so the module keeps working as before.
This condition can use 'BETWEEN' for better readability, see https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...
Given the limited amount of test accounts, there is no need for a queue worker.
Since this a module for developers, let's just use the time field and skip the checkbox.
A form field of 'type' => 'number' will only allow entering of integers. Config validation can do the server-side validation.
No need to type hint to integer here, since the configuration property has a config schema.
Comment #4
Guillaume.Klomp commentedRework for my last patch
Comment #5
Guillaume.Klomp commentedComment #6
idebr commenteddisable_after -> block_after
Let's match this text with the form label on the configuration form for consistency.
This text is displayed in the console when processing database updates, so it should describe the update being performanced. In this case 'Set a default value for
<form label>'This code can be a new service RoleTestAccountBlocker, and should be called after changing the configuration period.
There is no need to query inactive users when the timer is 0
Disable -> Block
automaticly -> automatically
There is no indication of how 'time' should be entered. Perhaps add a suffix 'seconds' here, so the unit is clear.
You can configure the minimum value for a "number" field in its renderable array:
'#type' => 'number',
'#min' => 0
Comment #7
Guillaume.Klomp commentedHere is the new patch
Comment #8
idebr commentedAttached patch implements the following changes:
Comment #10
idebr commentedCommitted, thanks!