salesagility / SuiteCRM

SuiteCRM - Open source CRM for the world
https://www.suitecrm.com
GNU Affero General Public License v3.0
4.53k stars 2.09k forks source link

Email Recipients of Scheduled Reports not rendered correctly in List View #9928

Open 2xaronl opened 1 year ago

2xaronl commented 1 year ago

Issue

I am using SuiteCRM 7.12.6 and found that after adding the 'Email Recipients' field of Scheduled Reports to the List View using Studio that the Email Recipients field is not rendered correctly. A long alphanumeric string of characters is shown instead of the 3 Users I had selected. The 'Email Recipients' field DOES render correctly in the Detail View. The issue persists whether I enter in the Email Recipients as a User within SuiteCRM or as an Email.

Expected Behavior

The Email Recipients field should be rendered correctly, like it does in the Detail View.

Actual Behavior

The Email Recipients field renders as a long alphanumeric string in List View but correctly in Detail View.

Possible Fix

Unsure at this time.

Steps to Reproduce

  1. Create a Scheduled Report and add an Email Recipient
  2. In Studio -> Scheduled Reports -> Layouts -> List View: add Email Recipients to either Default or Available then Save & Deploy
  3. View the Scheduled Reports List View, ensuring the Email Recipients field is selected as visible

Context

I just ran into this bug today. I wanted to be able to compare Email Recipients across Scheduled Reports so I could verify I had them set to the correct recipients without needing to view their Detail Views individually.

Your Environment

pgorod commented 1 year ago

Can you post the contents of this "a long alphanumeric string of characters is shown"? It might provide clues.

2xaronl commented 1 year ago

Emails: a@a.com in the Detail View gets shown as: YToyOntzOjE3OiJlbWFpbF90YXJnZXRfdHlwZSI7YToxOntpOjA7czoxMzoiRW1haWwgQWRkcmVzcyI7fXM6NToiZW1haWwiO2E6MTp7aTowO3M6NzoiYUBhLmNvbSI7fX0= in the List View.

Changing it to b@a.com yields: YToyOntzOjE3OiJlbWFpbF90YXJnZXRfdHlwZSI7YToxOntpOjA7czoxMzoiRW1haWwgQWRkcmVzcyI7fXM6NToiZW1haWwiO2E6MTp7aTowO3M6NzoiYkBhLmNvbSI7fX0=

2xaronl commented 1 year ago

After a hunch and a quick search, it looks like the text is being encoded in base64 for the List View.

pgorod commented 1 year ago

Exactly. That decodes to

a:2:{s:17:"email_target_type";a:1:{i:0;s:13:"Email Address";}s:5:"email";a:1:{i:0;s:7:"a@a.com";}}

and

a:2:{s:17:"email_target_type";a:1:{i:0;s:13:"Email Address";}s:5:"email";a:1:{i:0;s:7:"b@a.com";}}

for some reason it's saving an entire array in that field, not just the email address.

It would be interesting to find out how the detail view handles it...