Campaign Builder Contact Tags condition does not repopulate saved tags when editing
Mautic Series
7.2.x series
Mautic installed version
7.2.1
Way of installing
Other: existing self-hosted installation upgraded using Mautic's CLI updater.
PHP version
8.3.31
What browsers are you seeing the problem on?
Microsoft Edge
What happened?
In the Campaign Builder, a Contact Tags condition can be saved correctly with one or more tags, but when the condition is opened again for editing, the tag selector is displayed as empty.
This makes it look as if the condition has lost its configured tag and creates a significant risk of confusion when editing campaigns.
The saved condition itself is still correct in the database. We verified that the serialized campaign_events.properties contains the expected tag ID under the nested properties['tags'] value.
For example, after saving a test condition with tag ID 49:
s:10:"properties";a:1:{
s:4:"tags";a:1:{
i:0;s:2:"49";
}
}However, in the same serialized event data, the top-level form field is empty:
s:4:"tags";a:0:{}The Campaign Builder appears to render the editor from the empty form field instead of repopulating the selector from the persisted nested properties['tags'].
We also tested the potentially dangerous scenario:
- Save a Contact Tags condition with a tag.
- Reopen it. The tag selector appears empty.
- Do not select anything.
- Click Update.
- Save the campaign again.
- Inspect the database.
The previously saved tag remains present in properties['tags']. In our test, tag ID 49 was preserved. So this currently appears to be a UI/form hydration issue rather than data loss.
We reproduced the same behavior on multiple existing Contact Tags conditions in the same campaign, including conditions using different tag IDs.
Expected behavior
When editing an existing Contact Tags campaign condition, the tag selector should display the tag(s) already saved in the condition.
For example, if properties['tags'] = ['49'], the corresponding tag should already be selected when the modal opens.
Actual behavior
The tag selector is visually empty every time the saved condition is reopened, even though the tag is correctly persisted and continues to remain persisted after clicking Update without making changes.
How can we reproduce this issue?
- Create or edit a campaign in Campaign Builder.
- Add a Condition → Contact Tags event.
- Select any existing tag.
- Save the condition and save the campaign.
- Reopen the same Contact Tags condition.
- Observe that the tag selector is empty instead of showing the previously selected tag.
- Optionally inspect the
campaign_eventsrow in the database. The nested serializedproperties['tags']still contains the saved tag ID. - Click Update without reselecting the tag and save the campaign.
- Inspect the database again. The saved tag remains in
properties['tags'], despite the editor having displayed no selected tag.
Example database state after the second save:
properties => tags => ["49"]
...
top-level form tags => []Impact
The campaign runtime configuration appears to remain intact, but the UI gives the user no indication that a tag is configured.
For conditions used as safeguards before campaign actions, this is especially concerning because the user may reasonably assume the condition is empty or broken and unnecessarily modify a working campaign.
Relevant log output
No relevant application error was observed. This appears to be a Campaign Builder form/UI state hydration issue.
Code of Conduct
- I confirm that I have read and agree to follow this project's Code of Conduct
Care about this issue? Want to get it resolved sooner? If you are a member of Mautic, you can add some funds to the Bounties Project so that the person who completes this task can claim those funds once it is merged by a member of the core team! Read the docs here.
Source: mautic/mautic