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

dev/core#3981 Fix Examples to use 0 rather than a possibly-real contact_id #24945

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

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

…ct_id

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.

After
=======================================================================
The contact_id is set to 0. As a result nothing is retrievable from the databse.

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....
@civibot
Copy link

civibot bot commented Nov 10, 2022

No issue was found matching the number given in the pull request title. Please check the issue number.

@civibot
Copy link

civibot bot commented Nov 10, 2022

(Standard links)

@civibot civibot bot added the master label Nov 10, 2022
@eileenmcnaughton
Copy link
Contributor Author

api\v4\Entity\ExampleDataTest::testGet
Failed asserting that 0 matches expected 100.

/home/jenkins/bknix-dfl/build/core-24945-2dqjs/web/sites/all/modules/civicrm/tests/phpunit/api/v4/Entity/ExampleDataTest.php:63
/home/jenkins/bknix-dfl/extern/phpunit8/phpunit8.phar:1721

@colemanw colemanw merged commit 10f8344 into civicrm:master Nov 10, 2022
@eileenmcnaughton eileenmcnaughton deleted the ex_zero branch November 11, 2022 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants