Autologout disabled after 1.4 Upgrade

Created on 31 May 2023, over 1 year ago
Updated 20 September 2023, about 1 year ago

Problem/Motivation

After updating from autlogout 1.3 to 1.4 the new checkbox to enable / disable autologout is not set to enabled even after drush updb is run, if a drush cim was issued. (Aka drush deploy)

There is this postupdate in the module, which should update the checkbox for enabling autologout.

// Issue #3219414: Add a disable checkbox for autologout.
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('autologout.settings');
$disable_button = $config->get('enabled');
if ($disable_button === NULL) {
$config->set('enabled', TRUE);
}

I tried to update the module the second time now and it doesn't work if is intended like that.
Maybe it is autmatically disabeld again by the drush cim following up the drush updb.

That way It turned of autologout at our 100+ multisites until we rolled back to 1.3 and was leading to random logouts, sometimes only after minutes when the module is in its disabled / undefined state.

I am now up to run the update again, and this time I did set the checkbox and did run a drush cex. So it should be correct in production now but it is an easy trap to overlook.

Steps to reproduce

See above.

Proposed resolution

Set default for checkbox always to true as default or change it to a disabled on this site checkbox.

🐛 Bug report
Status

Closed: works as designed

Component

Code

Created by

🇩🇪Germany macdev_drupal Wiesbaden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @macdev_drupal
  • Status changed to Closed: works as designed about 1 year ago
  • 🇸🇮Slovenia deaom

    I tested this and the update is running as expected and setting the enabled to true, the issue happens when you then do the drush cim, which gets the old configuration that does not have that field, so it sets it back to disabled or rather NULL, basically overrides the drush updb changes.
    The solution to this is, do the drush updb, then do the drush cex so you can get the new configuration with the new enabled field.
    Maybe this step needs to be added to the readme or the documentation page, to make it more clear.
    But the updating of the field works as designed, so closing this issue as such.

Production build 0.71.5 2024