Finalize and cleanup module state

Created on 13 November 2023, 8 months ago
Updated 23 November 2023, 7 months 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.69.0 2024