New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable LS to import answers (.vv) between different installations/versions #138
Conversation
more details : |
Thanks, that makes it clearer. Also, I would generally be careful importing surveys and data back and forth between versions as there have been quite some changes to the data structure. These are handled when updating a system (and the db) from 192-->2.00 and 2.00-->2.05 but this is (usually) not the case when importing.lss/.txt-files...same is true for data. |
There is no safety or specificity in the new import system. It lets you import anything and if fields are missing, the user ends up with blank answers. Can we at least display a warning if some keys are missing in $aKeyForFieldNames when the import is performed ? I really don't get how you can refuse my patch (or an equivalent solution) while the official solution today, when an import doesn't work automatically, is to edit CSV files by hand... |
Hi, In 2.05 : you can:
WIth a 'order' solution : you broke this system. You can too import some Var from one survey and leave other NULL. Import only know var.
|
Please see : http://bugs.limesurvey.org/view.php?id=5740 |
I really don't understand your attitude here. My code adds an else block for the case when the current import system doesn't work. Without this else block the import goes on, and answers for which no CSV fields were found are imported as blank and not even a warning is issued to the user. Can you please explain (with facts) how it can break anything ? How could a system that ignores import errors be made more broken by a fallback solution ? In my opinion, #5740 isn't fixed at all because the test files provided by the person who reported the bug are still not working with LS 2.05. I was planning to re-open #5740 but it doesn't seem possible. All I want is to fix the situation when a user exported hundreds of lss and vv files from LS <2.05 and tries to import them into a new installation. Without my patch, this user has to edit all of his vv files by hand. In case you write code to properly check imports before committing data, just add a checkbox "force import" to enable my fallback solution for users who know what they are doing. |
Stay calm, i don't refuse , i don't have this power ..... i'm not the (only) one who decide. I just say it can break some system . If it can break some system, it must be an option (and think this option must be deactivated by default). And for 2.00 > 2.05 update and have all survey set : you can already use "lsa system" it' surely better. And the best are : copy DB/ Update DB with LS incorporated system. |
Grapsus, to me your solution looks fine. I just have a few questions: Do you, or could you, check the total number of columns when importing such a file?
If you respond quickly enough I'd like to merge this into 2.05 before the feature freeze of Oct 8th. Cheers! |
Hey, The code I posted seems to work. The algorithm works as follows :
What I can do and test today if you answer quickly :
|
{ | ||
if(preg_match('/^\d+X\d+X\d+/', $name)) | ||
{ | ||
$ans_start_index = $i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be $csv_ans_start_index ?
Okay:
Thanks in advance for the contribution! |
Made fallback import optionnal and disabled by default.
before committing import.
Hey,
I hope it's all good, tell me if you see any other correction before the feature freeze. |
A few styling changes.
enable LS to import answers (.vv) between different installations/versions
enable LS to import answers (.vv) between different installations/versions