View Issue Details

This bug affects 1 person(s).
 20
IDProjectCategoryView StatusLast Update
18557Bug reportsSurvey participants (Tokens)public2023-09-18 09:10
Reportermatithyah Assigned Tokfoster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18557: Email Template Attachments appear to carry over with copied survey, but do not work
Description

Surveys that are copied appear to carry over attachments inside the Email templates, but the invitation emails (for example) have no attachments when sent.

When viewing the copied survey's Email template page, the attachment appears; but it seems to be linked back to the file in the previous survey, rather than creating a new file for the new survey in the copying process. I wonder whether the invitation sending code disregards file attachments that belong to other surveys? Even though the editing page can access it.

Steps To Reproduce

Steps to reproduce

Set up a basic survey.
Attach a file to the Invitation Email template.
Add a Survey participant, and send them an invitation email

Email is sent with attachment.

Create a new survey by copying the first survey.
Leave the 'Copy survey resource files and adapt links' ticked when copying.
View the Invitation Email template - file appears as attached.
Add a Survey participant to the second survey, and send them an invitation email

Email is sent without attachment.

Expected result

Second/copied survey's invitation is sent with attachment.

Actual result

Second/copied survey's invitation is sent without attachment.

TagsNo tags attached.
Bug heat20
Complete LimeSurvey version number (& build)5.4.15+221212
I will donate to the project if issue is resolvedNo
Browser
Database type & versionmariadb 10.5.16
Server OS (if known)Linux Gentoo
Webserver software & version (if known)
PHP Version7.4.33

Relationships

related to 18602 closedtibor.pacalat When surveys are copied without copying attachments, attachment info is copied but not updated. 

Users monitoring this issue

matithyah

Activities

matithyah

matithyah

2022-12-15 05:00

reporter   ~73124

Apologies for the formatting mistake in the Steps to Reproduce box!

gabrieljenik

gabrieljenik

2023-01-23 13:13

manager   ~73533

The problem is that the attachment data array is not updated when you copy, so the URL/path still points to the original survey file.

Translate Links function was updated as well to be able to treat local paths

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2861

gabrieljenik

gabrieljenik

2023-01-23 13:19

manager   ~73534

This link translation only happens if the copy resources checkbox is check.

If it is not checked, the attachments info is copied but not updated.
Should we remove all attachments if so?
Add a new ticket?

c_schmitz

c_schmitz

2023-01-23 13:33

administrator   ~73535

Remove the attachments, but show an additional message in the result screen if that happened.

DenisChenu

DenisChenu

2023-01-23 13:46

developer   ~73538

If it is not checked, the attachments info is copied but not updated.
Add a new ticket?

Still a good idea, because it's not the same issue.

ollehar

ollehar

2023-02-21 14:41

administrator   ~73903

Waiting for feedback from Carsten regarding security warning in the PR.

gabrieljenik

gabrieljenik

2023-05-23 17:42

manager   ~75191

Last edited: 2023-05-23 17:43

When #18610 gets merged, the security issue will be solved, as we will have json in the xml, not a serialization

kfoster

kfoster

2023-08-24 12:41

developer   ~76694

I see Gabriels PR handles attachment path translation but it doesn't handle the case of missing attachments.

For a .lss import, no attachment files will be imported (unlike with a .lsa import). In this case the attachment data should be removed from the imported survey (with a warning?).

gabrieljenik

gabrieljenik

2023-08-24 15:49

manager   ~76696

@kfoster That sounds familiar. I think that's tackled here: 18602

gabrieljenik

gabrieljenik

2023-08-29 15:24

manager   ~76768

v5: https://github.com/LimeSurvey/LimeSurvey/pull/3403

guest

guest

2023-08-30 09:15

viewer   ~76777

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35421

guest

guest

2023-08-30 09:15

viewer   ~76778

Fix committed to 5.x branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35420

LimeBot

LimeBot

2023-09-04 10:53

administrator   ~76866

Fixed in Release 5.6.37+230905

gabrieljenik

gabrieljenik

2023-09-04 14:51

manager   ~76867

Master is pending

guest

guest

2023-09-07 15:01

viewer   ~76899

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=35445

tibor.pacalat

tibor.pacalat

2023-09-13 13:25

administrator   ~76975

@gabrieljenik both of these PRs have already been merged, is this still open because of https://bugs.limesurvey.org/view.php?id=18602 ?

gabrieljenik

gabrieljenik

2023-09-13 16:28

manager   ~77003

We can close it then, I guess :)

matithyah

matithyah

2023-09-14 01:29

reporter   ~77018

Thanks everyone for your work - greatly appreciated!

gabrieljenik

gabrieljenik

2023-09-14 13:55

manager   ~77031

Thanks! This wasn't easy!

LimeBot

LimeBot

2023-09-18 09:10

administrator   ~77104

Fixed in Release 6.2.7+230918

Related Changesets

LimeSurvey: 5.x e9449a72

2023-08-30 11:13

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18557: Email Template Attachments appear to carry over with copied survey, but do not work (#3403)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
18557
mod - application/helpers/admin/import_helper.php Diff File
mod - application/helpers/common_helper.php Diff File
add - tests/unit/helpers/TranslateLinksTest.php Diff File

LimeSurvey: 5.x e9449a72

2023-08-30 11:13

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18557: Email Template Attachments appear to carry over with copied survey, but do not work (#3403)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
18557
mod - application/helpers/admin/import_helper.php Diff File
mod - application/helpers/common_helper.php Diff File
add - tests/unit/helpers/TranslateLinksTest.php Diff File

LimeSurvey: master f083a6e7

2023-09-07 15:58

Gabriel Jenik

Committer: GitHub


Details Diff
Fixed issue 18557: Email Template Attachments appear to carry over with copied survey, but do not work (#2861)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
Affected Issues
18557
mod - application/helpers/admin/import_helper.php Diff File
mod - application/helpers/common_helper.php Diff File
add - tests/unit/helpers/TranslateLinksTest.php Diff File

Issue History

Date Modified Username Field Change
2022-12-15 04:58 matithyah New Issue
2022-12-15 04:59 matithyah Issue Monitored: matithyah
2022-12-15 04:59 matithyah Bug heat 0 => 2
2022-12-15 05:00 matithyah Note Added: 73124
2022-12-15 05:00 matithyah Bug heat 2 => 4
2022-12-16 12:26 ollehar Priority none => normal
2022-12-19 17:17 gabrieljenik Status new => acknowledged
2023-01-17 17:12 gabrieljenik Assigned To => gabrieljenik
2023-01-17 17:12 gabrieljenik Status acknowledged => assigned
2023-01-23 13:13 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-01-23 13:13 gabrieljenik Status assigned => ready for code review
2023-01-23 13:13 gabrieljenik Note Added: 73533
2023-01-23 13:13 gabrieljenik Bug heat 4 => 6
2023-01-23 13:19 gabrieljenik Note Added: 73534
2023-01-23 13:33 c_schmitz Note Added: 73535
2023-01-23 13:33 c_schmitz Bug heat 6 => 8
2023-01-23 13:46 DenisChenu Assigned To DenisChenu =>
2023-01-23 13:46 DenisChenu Status ready for code review => ready for testing
2023-01-23 13:46 DenisChenu Note Added: 73538
2023-01-23 13:46 DenisChenu Bug heat 8 => 10
2023-01-23 13:54 gabrieljenik Issue cloned: 18602
2023-01-23 13:54 gabrieljenik Relationship added related to 18602
2023-02-02 23:46 gabrieljenik Assigned To => ollehar
2023-02-02 23:46 gabrieljenik Status ready for testing => ready for merge
2023-02-21 14:41 ollehar Status ready for merge => feedback
2023-02-21 14:41 ollehar Note Added: 73903
2023-02-21 14:41 ollehar Bug heat 10 => 12
2023-05-23 17:42 gabrieljenik Note Added: 75191
2023-05-23 17:43 gabrieljenik Note Edited: 75191
2023-08-24 12:41 kfoster Note Added: 76694
2023-08-24 12:41 kfoster Bug heat 12 => 14
2023-08-24 15:49 gabrieljenik Note Added: 76696
2023-08-28 16:50 gabrieljenik Steps to Reproduce Updated
2023-08-29 15:24 gabrieljenik Assigned To ollehar => kfoster
2023-08-29 15:24 gabrieljenik Status feedback => ready for code review
2023-08-29 15:24 gabrieljenik Note Added: 76768
2023-08-30 09:15 Changeset attached => LimeSurvey 5.x e9449a72
2023-08-30 09:15 guest Note Added: 76777
2023-08-30 09:15 Changeset attached => LimeSurvey 5.x e9449a72
2023-08-30 09:15 guest Note Added: 76778
2023-08-30 09:15 guest Bug heat 14 => 16
2023-08-30 09:15 guest Bug heat 14 => 16
2023-09-04 10:53 LimeBot Note Added: 76866
2023-09-04 10:53 LimeBot Status ready for code review => closed
2023-09-04 10:53 LimeBot Resolution open => fixed
2023-09-04 10:53 LimeBot Bug heat 16 => 18
2023-09-04 14:51 gabrieljenik Status closed => in code review
2023-09-04 14:51 gabrieljenik Note Added: 76867
2023-09-07 15:01 Changeset attached => LimeSurvey master f083a6e7
2023-09-07 15:01 guest Note Added: 76899
2023-09-13 13:25 tibor.pacalat Note Added: 76975
2023-09-13 13:25 tibor.pacalat Bug heat 18 => 20
2023-09-13 16:28 gabrieljenik Note Added: 77003
2023-09-13 16:32 tibor.pacalat Status in code review => resolved
2023-09-14 01:29 matithyah Note Added: 77018
2023-09-14 13:55 gabrieljenik Note Added: 77031
2023-09-18 09:10 LimeBot Note Added: 77104
2023-09-18 09:10 LimeBot Status resolved => closed