Move tokens to database instead of configuration

Created on 21 May 2021, over 3 years ago
Updated 23 October 2023, about 1 year ago

Tokens are too easily overwritten/lost when sites are multi-environment and configuration sync is used. While there are ways to set it up to avoid this it can be confusing. Instead let's move the tokens to a database table.

✨ Feature request
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    +1 for re-considering moving this to the database.

    I'm new to using this module (great work, by the way!) but not new to Drupal at all. It seems a bit off-putting that every time I run a config export, the ik_constant_contact.tokens.yml file is show changes. It seems like if that's the case then this technically isn't configuration and more of a temporary content item that is constantly changing. I wonder if we could consider this an item that could simply live in the cache database table?

  • Status changed to Active over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

    Thanks! That's not a bad idea. I'll reopen this for consideration. (Updating the version as well)

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    Thanks so much for this! This is looking good in my initial testing!

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    One of the new updates appears to be failing when trying to update the site via drush. Here's the error I'm seeing:

    Update failed: ik_constant_contact_update_93103 
     [error]  Update aborted by: ik_constant_contact_update_93103
  • πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

    Do you have any additional information via drupal logs?

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    I wasn't getting any useful info from Drush or dblog, so I ran the update in the browser. Here's what it shows there:

    ik_constant_contact module
    Update #93103
    Failed: Drupal\Core\Utility\UpdateException: There was an error running this update. in ik_constant_contact_update_93103() (line 137 of /app/web/modules/contrib/ik_constant_contact/ik_constant_contact.install).
  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    One thing I see in update 93103 is it's checking for $ccConfig['token_source'] === 'database' and in my debugging it looks like $ccConfig['token_source'] is currently set to config which would result in the exception taking place.

  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

    Thanks, that helps! I'll take a look as soon as I can. Moving back to needs work status.

  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

    Ok rerolled the patch. Let's see how this does.

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States rosemarystanley

    Rolled this into 3.1.4 release.

  • Status changed to Fixed about 1 year ago
Production build 0.71.5 2024