Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18612Bug reportsImport/Exportpublic2023-05-05 17:57
Reportergabrieljenik Assigned Totibor.pacalat  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18612: When surveys are copied without copying resources, links are not handled.
Description

When copying a survey WITH copying resources, links are translated by translateLinks().
When copying a survey WITHOUT copying attachments, links are not handled at all.

Then, they end up pointing to an old survey and usually without being noticeable.

Steps To Reproduce
  • Create a survey with a file embedded on the welcome page
  • Copy the survey without copying attachments.

Expected:

  • After copying, a warning shall be shown saying there are links pointing to other surveys.
  • Old file shouldn't be shown on the welcome page

Actual:

  • No warning is shown.
  • Old file is being shown
TagsNo tags attached.
Bug heat8
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 18700 confirmed Whe importing, translatelinks is used even though the option has not been checked 
related to 18701 confirmed When surveys are copied copying resources, some links are not handled. 

Activities

gabrieljenik

gabrieljenik

2023-01-31 20:23

manager   ~73623

I think we could reuse the same mechanism that translateLinks uses for informing if there are links to the source surveys.

c_schmitz

c_schmitz

2023-02-09 13:45

administrator   ~73775

I agree.

gabrieljenik

gabrieljenik

2023-03-23 20:37

manager   ~74255

https://github.com/LimeSurvey/LimeSurvey/pull/3009

tibor.pacalat

tibor.pacalat

2023-05-04 17:00

administrator   ~74823

@gabrieljenik I tested this in 5.x and I could reproduce this issue only with links in welcome message, links in questions were correctly translated and not shown.

With the fix:
I can see notifications about outdated links if I try to copy it without resources.
But, I can still see images even though they are from another survey.

gabrieljenik

gabrieljenik

2023-05-04 19:17

manager   ~74826

But, I can still see images even though they are from another survey.

Yes, makes sense.
The checkbox is for copying recources and also translating links.
As not checked, we don't translate, but inform if a link is pointing to an old survey.

I notice there are some unfullfilled expectations, as I guess you expected the link to be translated (so did I at a first glance).
This related ticket could help https://bugs.limesurvey.org/view.php?id=18700

Thanks

tibor.pacalat

tibor.pacalat

2023-05-05 17:51

administrator   ~74865

Merged.

guest

guest

2023-05-05 17:57

viewer   ~74870

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

guest

guest

2023-05-05 17:57

viewer   ~74871

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

Related Changesets

LimeSurvey: master e979de0a

2023-05-05 17:51:27

Gabriel Jenik


Committer: GitHub Details Diff
Fixed issue 18612: When surveys are copied without copying resources links are not handled (#3009)

* Fixed issue 18612: When surveys are copied without copying resources, links are not handled

* Fixed issue 18612: When surveys are copied without copying resources links are not handled

Unit tests for checkOldLinks function added.

---------

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

LimeSurvey: master e979de0a

2023-05-05 17:51:27

Gabriel Jenik


Committer: GitHub Details Diff
Fixed issue 18612: When surveys are copied without copying resources links are not handled (#3009)

* Fixed issue 18612: When surveys are copied without copying resources, links are not handled

* Fixed issue 18612: When surveys are copied without copying resources links are not handled

Unit tests for checkOldLinks function added.

---------

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

Issue History

Date Modified Username Field Change
2023-01-31 20:22 gabrieljenik New Issue
2023-01-31 20:22 gabrieljenik Issue generated from: 18602
2023-01-31 20:23 gabrieljenik Note Added: 73623
2023-01-31 20:23 gabrieljenik Bug heat 0 => 2
2023-02-03 12:42 gabrieljenik Status new => confirmed
2023-02-09 13:45 c_schmitz Note Added: 73775
2023-02-09 13:45 c_schmitz Bug heat 2 => 4
2023-02-16 16:30 gabrieljenik Assigned To => gabrieljenik
2023-02-16 16:30 gabrieljenik Status confirmed => assigned
2023-03-23 20:31 gabrieljenik Issue cloned: 18700
2023-03-23 20:31 gabrieljenik Relationship added related to 18700
2023-03-23 20:34 gabrieljenik Issue cloned: 18701
2023-03-23 20:34 gabrieljenik Relationship added related to 18701
2023-03-23 20:37 gabrieljenik Assigned To gabrieljenik => DenisChenu
2023-03-23 20:37 gabrieljenik Status assigned => ready for code review
2023-03-23 20:37 gabrieljenik Note Added: 74255
2023-03-26 15:20 DenisChenu Assigned To DenisChenu =>
2023-03-26 15:20 DenisChenu Status ready for code review => ready for testing
2023-04-25 15:54 gabrieljenik Assigned To => tibor.pacalat
2023-04-25 15:54 gabrieljenik Status ready for testing => ready for merge
2023-05-04 17:00 tibor.pacalat Note Added: 74823
2023-05-04 17:00 tibor.pacalat File Added: Screenshot 2023-05-04 at 16.52.59.png
2023-05-04 17:00 tibor.pacalat File Added: Screenshot 2023-05-04 at 16.55.15.png
2023-05-04 17:00 tibor.pacalat Bug heat 4 => 6
2023-05-04 19:17 gabrieljenik Note Added: 74826
2023-05-05 17:51 tibor.pacalat Status ready for merge => closed
2023-05-05 17:51 tibor.pacalat Resolution open => fixed
2023-05-05 17:51 tibor.pacalat Note Added: 74865
2023-05-05 17:57 Changeset attached => LimeSurvey master e979de0a
2023-05-05 17:57 Changeset attached => LimeSurvey master e979de0a
2023-05-05 17:57 guest Note Added: 74870
2023-05-05 17:57 guest Note Added: 74871
2023-05-05 17:57 guest Bug heat 6 => 8
2023-05-05 17:57 guest Bug heat 6 => 8