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

Link not found exception is thrown #180

Closed
Saboteur777 opened this issue Oct 7, 2020 · 9 comments
Closed

Link not found exception is thrown #180

Saboteur777 opened this issue Oct 7, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@Saboteur777
Copy link
Contributor

Describe the bug

Visiting the links from a sent email (e.g.: actions/campaign/t/click?cid=CID&sid=SID) ends up in a 404.

To reproduce

Steps to reproduce the behaviour:

  1. Send a sendout.
  2. Click on a link in the sent e-mail.
  3. See error message "Link not found.".

Expected behaviour

Links should not throw 404.

yii\web\NotFoundHttpException: Link not found. in /var/www/vendor/putyourlightson/craft-campaign/src/controllers/TrackerController.php:81
Stack trace:
#0 [internal function]: putyourlightson\campaign\controllers\TrackerController->actionClick()
#1 /var/www/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array()
#2 /var/www/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams()
#3 /var/www/vendor/craftcms/cms/src/web/Controller.php(189): yii\base\Controller->runAction()
#4 /var/www/vendor/yiisoft/yii2/base/Module.php(528): craft\web\Controller->runAction()
#5 /var/www/vendor/craftcms/cms/src/web/Application.php(274): yii\base\Module->runAction()
#6 /var/www/vendor/craftcms/cms/src/web/Application.php(577): craft\web\Application->runAction()
#7 /var/www/vendor/craftcms/cms/src/web/Application.php(253): craft\web\Application->_processActionRequest()
#8 /var/www/vendor/yiisoft/yii2/base/Application.php(386): craft\web\Application->handleRequest()
#9 /var/www/web/index.php(21): yii\base\Application->run()
#10 {main}

Versions

  • Plugin version: 1.16.1
  • Craft version: 3.5.12.1
@Saboteur777 Saboteur777 added the bug Something isn't working label Oct 7, 2020
@bencroker
Copy link
Collaborator

bencroker commented Oct 7, 2020

It sounds like the link is invalid or may have been deleted. What would you expect to happen in this situation?

@Saboteur777
Copy link
Contributor Author

Okay, I dug into code and realized there should be a lid parameter on the link. It is there, but the = is missing, that's why the LinkRecord is not found:

/actions/campaign/t/click?cid=c5f19bcd45271fyHJ&sid=s5f7e116f8380bpai&lidl5f7d88fcb8ef6msm

@bencroker
Copy link
Collaborator

So is the URL you received incorrect? Perhaps miscopied or manipulated by the email client?

@Saboteur777
Copy link
Contributor Author

It is incorrect as the $lid parameter is appended without the =, so the parameter won't be found by the TrackerController, hence the 404.

I am using Mailhog for local testing, so no email client is in the equation.

@Saboteur777
Copy link
Contributor Author

output

@bencroker
Copy link
Collaborator

This appears to be caused by a bug introduced in Craft 3.5.12, see craftcms/cms#6900 (comment).

@Saboteur777
Copy link
Contributor Author

Thanks for going after this, this is so exciting! 😀

@bencroker
Copy link
Collaborator

I decided to fix this in b2c6e46 after all as this is a rather nasty bug and I cannot know if and when it will be fixed in Craft. Released in version 1.16.2, thanks for reporting it!

@Saboteur777
Copy link
Contributor Author

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants