View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
16421Bug reportsImport/Exportpublic2020-06-30 14:03
Reporterasshank Assigned Toollehar  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.3.1 
Summary16421: surveyGetXMLData() not producing valid XML
Description

Using surveyGetXMLData() to build a XML file for import into XMLImportSurvey() is producing an
'Extra content at the end of the document'
error.

Examening the produced XML I can see why (the newly normalized language structure is appended as well as themes)

After the closing
</Document>
The output is going on with
<group_l10ns>
<fields>
<fieldname>id</fieldname>
<fieldname>gid</fieldname>
<fieldname>group_name</fieldname>
<fieldname>description</fieldname>
<fieldname>language</fieldname>
<fieldname>sid</fieldname>

Steps To Reproduce

Hard to reproduce.. I use these functions in a plugin (Lime3 worked ok)!
But that's OK I found the bug!
I will make a PR

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)limesurvey4.3.1+200623
I will donate to the project if issue is resolvedNo
BrowserAll
Database type & versionmariadb
Server OS (if known)centos
Webserver software & version (if known)apache
PHP Version7.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

asshank

asshank

2020-06-23 17:51

reporter   ~58416

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

asshank

asshank

2020-06-23 18:03

reporter   ~58417

Made a small error in https://github.com/LimeSurvey/LimeSurvey/pull/1444. second commit is the valid one!

asshank

asshank

2020-06-24 00:43

reporter   ~58421

Oops.. I think there is the same problem in the getXMLDataSingleTable() function..
I can' test that right now!

on line 998 there is also to much ($xml->endElement(); // close columns)
https://github.com/LimeSurvey/LimeSurvey/pull/1444/commits/0c56e8f067a1dd5979d3e212c53876335a6891db

asshank

asshank

2020-06-24 09:03

reporter   ~58423

Please look at every
$xml->endElement(); // close columns
line in /application/helpers/export_helper.php.. I think they are all at fault and should be removed!
As I say I can't test them all!

asshank

asshank

2020-06-24 09:51

reporter   ~58424

Creating a new survey based on an existing survey in the adminpanel from Limesurvey (copy a survey) is also not working.
Fixed with the above pull-request.

asshank

asshank

2020-06-25 07:49

reporter   ~58434

@carsten IMHO it is NOT fixed in https://github.com/LimeSurvey/LimeSurvey/commit/a877f78df366fd5ff1546f41389e3a775eb0a83c

ollehar

ollehar

2020-06-25 12:22

administrator   ~58449

Are you using MySQL 8?

asshank

asshank

2020-06-25 15:08

reporter   ~58454

IMHO: The wrong XML has nothing to do with MYSQL8.. It just is not valid anymore. Due to one close tag to many.
Therefore look in the code to every line with
$xml->endElement(); // close columns
This line renders the XML invalid!

ollehar

ollehar

2020-06-25 15:09

administrator   ~58455

It has to do with MySQL 8 due to the new keyword "groups", our escaping fix, and a pattern match.

DenisChenu

DenisChenu

2020-06-25 15:13

developer   ~58456

@asshank : i juts update 3.X this morning (yes : 3.X)

Before the update : xml broken, after update : xml OK …

Unsure it's this fix , but : please can you check ?

asshank

asshank

2020-06-25 15:20

reporter   ~58460

we prefer to concentrate our testing to 4.x.
As far as I know there was no issue in 3.x.
without the fix we can't copy a survey in 4.3, with the suggested fix we can..

ollehar

ollehar

2020-06-25 15:22

administrator   ~58461

You use git to pull?

DenisChenu

DenisChenu

2020-06-25 15:22

developer   ~58462

I mean : test on 4.X :)

asshank

asshank

2020-06-25 15:22

reporter   ~58463

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

ollehar

ollehar

2020-06-25 15:24

administrator   ~58464

Can you attach an lss file with which we can reproduce the issue? Or describe in detail how to reproduce it. Thank you.

DenisChenu

DenisChenu

2020-06-25 15:28

developer   ~58465

Before Mise à jour e55a12f35b..a877f78df3

See screnshot (debug =2)

After :
see lss (broken)

DenisChenu

DenisChenu

2020-06-25 15:29

developer   ~58466

@asshank : rthink your last commit are an issue : https://github.com/LimeSurvey/LimeSurvey/pull/1444/commits/16a78259429d412b512c5439a5e8045907ad571d

asshank

asshank

2020-06-25 15:44

reporter   ~58470

Because there was no reaction on my fix yesterday I tried to wothdraw the pull...

this https://github.com/LimeSurvey/LimeSurvey/pull/1444/commits/0c56e8f067a1dd5979d3e212c53876335a6891db php has the correct code to get Copy Survey working again!

But I noticed a lot of problems.. boiling down to the lines with
$xml->endElement(); // close columns

See earlies comments

ollehar

ollehar

2020-06-25 15:46

administrator   ~58471

I just pushed another fix to LS3. I will cherry-pick it into LS4.

ollehar

ollehar

2020-06-25 15:53

administrator   ~58473

Hm, looks like the needed fix was already applied to LS4.

In any case, more info needed to be able to reproduce.

asshank

asshank

2020-06-25 16:00

reporter   ~58474

in github I see the FIX from Carsten 14 hours ago.
But my fix about the $xml->endElement(); // close columns is NOT there!
But maybe I'm looking in the wrong branch in github!? https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/export_helper.php

We have exactly this patch https://github.com/LimeSurvey/LimeSurvey/pull/1444/commits/0c56e8f067a1dd5979d3e212c53876335a6891db installed on our Lime4 (limesurvey4.3.1+200623) and we can Copy Surveys again!

ollehar

ollehar

2020-06-25 16:01

administrator   ~58475

Please understand, without proper instructions of how to reproduce the issue, we can't help you.

DenisChenu

DenisChenu

2020-06-25 16:06

developer   ~58476

@asshank : i just with last git version

  1. Create a new survey with checking 'create sample question'
  2. Export without updating it
  3. Can be imported

MLaybe some other fix fix differently … we don't have this issue at start of 4.0 : xml is OK

asshank

asshank

2020-06-26 09:35

reporter   ~58513

Just did a test with Version 4.3.1+200623.
importing the lss from Denis [limesurvey_survey_created.lss] goes perfect.
copying the survey generates the discussed error.
See attached screenshots

2020-06-26_09h32_08.png (46,958 bytes)   
2020-06-26_09h32_08.png (46,958 bytes)   
2020-06-26_09h31_39.png (33,192 bytes)   
2020-06-26_09h31_39.png (33,192 bytes)   
DenisChenu

DenisChenu

2020-06-26 09:59

developer   ~58515

Just did a test with Version 4.3.1+200623.

This commit : https://github.com/LimeSurvey/LimeSurvey/commit/a877f78df366fd5ff1546f41389e3a775eb0a83c is not in 4.3.1+200623.

ollehar

ollehar

2020-06-26 10:38

administrator   ~58516

No, but it will be in 4.3.2 on Monday. :)

asshank

asshank

2020-06-26 10:38

reporter   ~58517

Probably your looking ay the version modified by Carsten.
w'll simply wait for the new version and test it again.
We have our own fix that we can use for now :)
To be continued!

DenisChenu

DenisChenu

2020-06-26 10:49

developer   ~58519

@asshank : but you can test applying the fix :)

ollehar

ollehar

2020-06-26 11:50

administrator   ~58520

Please test with new release next Monday.

asshank

asshank

2020-06-30 14:02

reporter   ~58576

tested, seems to be working now.
thanks!

Issue History

Date Modified Username Field Change
2020-06-23 17:47 asshank New Issue
2020-06-23 17:51 asshank Note Added: 58416
2020-06-23 18:03 asshank Note Added: 58417
2020-06-24 00:43 asshank Note Added: 58421
2020-06-24 09:03 asshank Note Added: 58423
2020-06-24 09:51 asshank Note Added: 58424
2020-06-25 07:49 asshank Note Added: 58434
2020-06-25 12:22 ollehar Note Added: 58449
2020-06-25 15:08 asshank Note Added: 58454
2020-06-25 15:09 ollehar Note Added: 58455
2020-06-25 15:13 DenisChenu Note Added: 58456
2020-06-25 15:20 asshank Note Added: 58460
2020-06-25 15:22 ollehar Note Added: 58461
2020-06-25 15:22 DenisChenu Note Added: 58462
2020-06-25 15:22 asshank Note Added: 58463
2020-06-25 15:24 ollehar Note Added: 58464
2020-06-25 15:28 DenisChenu Note Added: 58465
2020-06-25 15:28 DenisChenu File Added: Capture d’écran du 2020-06-25 15-26-36.png
2020-06-25 15:28 DenisChenu File Added: limesurvey_survey_734555.lss
2020-06-25 15:28 DenisChenu File Added: Capture d’écran du 2020-06-25 15-28-20.png
2020-06-25 15:29 DenisChenu Note Added: 58466
2020-06-25 15:44 asshank Note Added: 58470
2020-06-25 15:46 ollehar Note Added: 58471
2020-06-25 15:53 ollehar Note Added: 58473
2020-06-25 15:54 ollehar Status new => feedback
2020-06-25 16:00 asshank Note Added: 58474
2020-06-25 16:00 asshank Status feedback => new
2020-06-25 16:01 ollehar Note Added: 58475
2020-06-25 16:06 DenisChenu Note Added: 58476
2020-06-25 16:06 DenisChenu File Added: limesurvey_survey_created.lss
2020-06-26 09:35 asshank Note Added: 58513
2020-06-26 09:35 asshank File Added: 2020-06-26_09h32_08.png
2020-06-26 09:35 asshank File Added: 2020-06-26_09h31_39.png
2020-06-26 09:59 DenisChenu Note Added: 58515
2020-06-26 10:38 ollehar Note Added: 58516
2020-06-26 10:38 asshank Note Added: 58517
2020-06-26 10:49 DenisChenu Note Added: 58519
2020-06-26 11:50 ollehar Assigned To => ollehar
2020-06-26 11:50 ollehar Status new => feedback
2020-06-26 11:50 ollehar Note Added: 58520
2020-06-30 14:02 asshank Note Added: 58576
2020-06-30 14:02 asshank Status feedback => assigned
2020-06-30 14:03 ollehar Status assigned => closed
2020-06-30 14:03 ollehar Resolution open => fixed