Rock icon indicating copy to clipboard operation
Rock copied to clipboard

PageRoute Lava Filter - throws exception if used in context of a System Communication

Open stanalyst opened this issue 10 months ago • 0 comments

Description

Trying to use the PageRoute filter to build a link inside of a system communication - it throws an exception when that communication is triggered: "Lava Error: Object reference not set to an instance of an object." BUT ... strangely if that same system communication is sent via a workflow action instead - it doesn't throw the exception and the results are as desired.

Actual Behavior

Throws the exception: "Lava Error: Object reference not set to an instance of an object." whenever the PageRoute filter is used inside a system communication.

Expected Behavior

Should be able to use this filter inside the message body of a system communication to build desired link without an exception.

Steps to Reproduce

  • setup a new system communication place the following code into the message body (The page id and person id are from rock demo site ... replace them as needed). {{ 93 | PageRoute:'PersonId=1' }}
  • setup a method for triggering this system communication (other than from a workflow action) ... it has to be something that runs unattended (i.e. without the user interface). I used a system job to send attendance reminders and limited it to just a single test group - then manually ran the job.
  • open the email that was and note the lava exception "Lava Error: Object reference not set to an instance of an object." OR in the case of the demo site since it doesn't have SMTP setup - go to the exceptions log and see the same lava error. image

NOTE: You can put this code {{ 93 | PageRoute:'PersonId=1' }} into an HTML block on a page (or in lava tester) ... and you should get /person/1 output (or something similar)

Issue Confirmation

  • [X] Perform a search on the Github Issues to see if your bug or enhancement is already reported.
  • [X] Try to reproduce the problem on a fresh install or on the demo site.

Rock Version

1.16.2.1

Client Culture Setting

en-US

stanalyst avatar Apr 02 '24 17:04 stanalyst