Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool is letting us delete a list without checking associated campaigns - Throwing 500 error. #170

Open
Satendra-SR opened this issue Dec 18, 2023 · 0 comments

Comments

@Satendra-SR
Copy link
Member

Describe the bug
The user can delete a list from the campaign UI including the campaigns which are associated with an existing(past campaign). Due to this, the system is throwing 500 error as the list associated with the campaigns are not anymore in the database after deletion.

To Reproduce
Steps to reproduce the behaviour:

  1. Login to the campaign tool
  2. Go to the List tab
  3. Delete one list which is associated with any campaign in the past - The list should be deleted without any issue/warning.
  4. Come back to the campaign page - The campaign page should be throwing fatal error Trying to get property 'name' of non-object due to this code snippet $campaign->subscriptionList->name - Reference link to codebase

Expected behaviour

  • If the list is associated with an old campaign, the system should not let it deleted.
  • There should be a warning/alert while deleting such a list from the campaign tool.

Additional context

  1. Ideally, there should be a reference between the campaigns table and the lists table. However, it is being referenced in the codebase - Codebase Reference
  2. The column name could have been simply list_id in campaigns table rather than subscription_list_id, which may create confusion.
image

Acceptance Criteria

  • Add the foreign key constraint in the campaigns table for the subscription_list_id and add the lists table as a reference table for that.
  • The system should not let us delete the list if it is associated with an old campaign.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant