On the Limesurvey database the table prefix is set to "" (blank, there is no table prefix).
When I set the 'LimeSurvey database prefix' to blank in the module settings on Drupal,
The LimeSurvey site database tables are OK (green checkmark)
The LimeSurvey site url is OK (green checkmark)
but there are errors:
user warning: Table 'db_lime.lime_surveys_languagesettings' doesn't exist query: INSERT INTO lime_surveys_languagesettings(surveyls_survey_id, surveyls_title, surveyls_description) VALUES (159, 'Fake survey #159 from the drupal site http://www.example.com/', 'This survey is not functionnal, it is generated by the LimeSurvey Sync Drupal module from the synchronisation setting page http://www.example.com/index.php?q=admin/config/media/ls_sync') in /home/user1/public_html/drupal/sites/all/modules/limesurvey_sync/ls_api/limesurvey_sync_api_sync.inc on line 562.
The same error for table lime_surveys on line 561.
I've tried changing line 120 on limesurvey_sync/ls_api/limesurvey_sync_api_sync.inc:
$ls_settings = variable_get('ls_settings', array('ls_db_prefix' => 'lime_'));
to
$ls_settings = variable_get('ls_settings', array('ls_db_prefix' => ''));
But I did not work. I gues i'm not that good at coding.
And don't tell me that bugs are features :)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fix_fake_survey_db_prefix_table-2146589-3.patch | 3.77 KB | thedut |
Comments
Comment #1
agent_danniel commentedI'm using 2 different domain-names (on the same server: localhost)
$db_url['default'] = 'mysql://username:password@localhost/databasename';
$db_url['ls'] = 'mysql://username:password@your_LimeSurvey_host/your_LimeSurvey_database_name';
Comment #2
thedut commentedHello agent_danniel
Yes it is a bug !
Try this : Edit
function limesurvey_sync_fake_survey($sid = '', $action = 'create') {by
function limesurvey_sync_fake_survey($sid = '', $action = 'create', $ls_settings) {$success1 = db_query('INSERT INTO ' . limesurvey_sync_table('surveys') . " (sid, active, listpublic, owner_id, admin, language, datecreated) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s')", array_values(array_merge($for_fake_survey, $fix_insert)));by
$success1 = db_query('INSERT INTO ' . limesurvey_sync_table('surveys', '', $ls_settings) . " (sid, active, listpublic, owner_id, admin, language, datecreated) VALUES (%d, '%s', '%s', %d, '%s', '%s', '%s')", array_values(array_merge($for_fake_survey, $fix_insert)));$success2 = db_query('INSERT INTO ' . limesurvey_sync_table('surveys_languagesettings') . "(surveyls_survey_id, surveyls_title, surveyls_description) VALUES (%d, '%s', '%s')", array_values($surveys_languagesettings));by
$success2 = db_query('INSERT INTO ' . limesurvey_sync_table('surveys_languagesettings', '', $ls_settings) . "(surveyls_survey_id, surveyls_title, surveyls_description) VALUES (%d, '%s', '%s')", array_values($surveys_languagesettings));$success1 = db_query('DELETE FROM ' . limesurvey_sync_table('surveys') . ' WHERE sid = %d', $sid);by
$success1 = db_query('DELETE FROM ' . limesurvey_sync_table('surveys', '', $ls_settings) . ' WHERE sid = %d', $sid);$success2 = db_query('DELETE FROM ' . limesurvey_sync_table('surveys_languagesettings') . ' WHERE surveyls_survey_id = %d', $sid);by
$success2 = db_query('DELETE FROM ' . limesurvey_sync_table('surveys_languagesettings', '', $ls_settings) . ' WHERE surveyls_survey_id = %d', $sid);$fake_sid = limesurvey_sync_fake_survey();by
$fake_sid = limesurvey_sync_fake_survey('', 'create', $settings);limesurvey_sync_fake_survey($fake_sid, 'delete');by
limesurvey_sync_fake_survey($fake_sid, 'delete', $settings);and report.
Comment #3
thedut commentedHere is the corresponding patch.
This issue should only appears on v6.x-1.3 to 1.5, with a LimeSurvey database prefix distinct to the default value : 'lime_'.
The 7.x-1.x branch is not concerned.
I will merge this patch into the next release.
Comment #4
thedut commentedFixed into the LimeSurvey Sync 6.x-1.6 release.