Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I want to filter each campaign created by the user who created it. So I guess I will need to add an "uid" field in the "mailchimp_campaigns" table. Is there any other way to do that? If not where do I put my code to update the table with uid? I tried in the "mailchimp_campaign_save" function, but for some reasons it's not working. Any ideas?
Comments
Comment #1
ruscoe CreditAttribution: ruscoe commentedYou can achieve this with a combination of hook_install and hook_schema_alter.
In your module's .install file, you'll need something like this:
If you already have a site using your module, replace hook_install with hook_update_N.
Then you just need to use hook_form_alter on the MailChimp Campaign form to add your UID field.
Feel free to reopen this ticket if you need any assistance.