Finalize and cleanup module state

Created on 13 November 2023, about 1 year ago
Updated 23 November 2023, about 1 year ago

Problem/Motivation

Before making a release let's take one last pass to clean up the module state and config settings.

One thing I noticed is a difference between client_id and secret_id, we should make secret_id be client_secret I think.

We should also add a "last synced" timestamp state for the various importers. The cron job can use this same state to limit how frequently these things are checked.

Also, need to make sure we clean up this state on module uninstall. @m.stenta just shared an example:

/**
 * Implements hook_uninstall().
 */
function mymodule_uninstall() {

  // Delete all "mymodule.*" state values.
  foreach (\Drupal::keyValue('state')->getAll() as $key => $value) {
    if (strpos($key, 'mymodule') === 0) {
      \Drupal::state()->delete($key);
    }
  }
}


Steps to reproduce

N/A

Proposed resolution

Implement

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States paul121 Spokane, WA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024