dev/core#3981 Fix Examples to use 0 rather than a possibly-real contact_id #24945
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
dev/core#3981 Fix Examples to use 0 rather than a possibly-real contact_id
https://lab.civicrm.org/dev/core/-/issues/3981
Before
When using the Message Admin UI and trying out tokens those that are not explicitly defined in the sample data are fetched from the database from the contact whose id has been arbitrarily used. (screenshots in the gitlab https://lab.civicrm.org/dev/core/-/issues/3981)
After
The contact_id is set to 0. As a result nothing is retrievable from the database and undefined parameters stay blank
Technical Details
I suspect this was not possible when the example was first written (the token code has matured a bit) & a stand in number seemed intuitive - but I think that is arguable even when there are no negative side effects (for example if a url were in the letter then linking to a random contact from it is kinda confusing) - but really loses it's potency as an argument when there ARE negative side effects
Comments
I'm pretty sure there are some tests I need to adjust for this.... but from my UI testing this works fine & removes the leakage
@totten