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

Fix error 500 when opening tracked links on email when logged #6441

Merged

Conversation

Enc3phale
Copy link
Contributor

@Enc3phale Enc3phale commented Aug 9, 2018

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Y
New feature? N
Automated tests included? N
Related user documentation PR URL N
Related developer documentation PR URL N
Issues addressed (#s or URLs) #6400
BC breaks? N
Deprecations? N

Description:

Fix error 500 when opening tracked links on email when logged in to Mautic.
Since the trackedContact can be null it was missing a condition.

Steps to reproduce the bug:

  1. Create an email for a campaign and add a link with the builder
  2. Create a campaign to send the mail
  3. Send mail to a contact
  4. Open the sent email and click on any link
  5. Mautic will raise a 500 error

Steps to test this PR:

  1. Apply the PR
  2. It's now good

@npracht npracht added bug Issues or PR's relating to bugs ready-to-test PR's that are ready to test code-review-needed PR's that require a code review before merging labels Aug 9, 2018
@npracht npracht added this to the 2.14.1 milestone Aug 9, 2018
Copy link
Sponsor Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code change cannot hurt 👍

@escopecz escopecz added the pending-test-confirmation PR's that require one test before they can be merged label Aug 9, 2018
@npracht npracht removed code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test pending-test-confirmation PR's that require one test before they can be merged labels Aug 9, 2018
@npracht npracht added the ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged label Aug 9, 2018
@guizero
Copy link

guizero commented Aug 10, 2018

Thanks for that @Enc3phale!

@vitordesousa
Copy link

Thanks @Enc3phale!

@nartcan
Copy link

nartcan commented Aug 30, 2018

Thank you.

@heathdutton heathdutton merged commit 5f0d835 into mautic:staging Sep 4, 2018
@escopecz escopecz removed ready-to-commit PR's with 2 successful tests, 1 approval, automated tests and docs and is ready to be merged labels Oct 2, 2018
@Pixman
Copy link

Pixman commented Nov 8, 2018

Hello,
I suggest you can change the line 173 of the file app/bundles/LeadBundle/Helper/ContactRequestHelper.php
On my platform this modfication correct a 500 error code bug if a connected admin click on email link.

- if ($foundContact->getId() !== $this->trackedContact->getId()) {
+ if ($this->trackedContact && $foundContact->getId() !== $this->trackedContact->getId()) {

@mabdelfattah
Copy link

@Pixman I tried your patch but it did not work, I'm getting the following error instead:

mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function isAnonymous() on null" at /app/bundles/LeadBundle/Helper/ContactRequestHelper.php line 242 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function isAnonymous() on null at /app/bundles/LeadBundle/Helper/ContactRequestHelper.php:242)"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues or PR's relating to bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet