View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
17730 | Bug reports | Survey editing | public | 2021-11-17 15:31 | 2022-02-28 11:57 |
Reporter | mhladun | Assigned To | galads | ||
Priority | none | Severity | minor | ||
Status | closed | Resolution | no change required | ||
Product Version | 5.2.x | ||||
Summary | 17730: Survey Theme Update - Datecreated is Invalid | ||||
Description | I've inquired about this issue here: https://forums.limesurvey.org/forum/development/125954-theme-update-datecreated-is-invalid. Basically, when updating from one existing theme to another, the error message "Survey could not be updated, please fix the following error: The format of Datecreated is invalid." appears. See the attached image for the error message overlaying the page. The themes I am switching between are pre-installed themes like "Fruity" and "Vanilla". The error is raised after clicking the Save button. I've tried updating LS a few times. I started at 5.1.17+211025 then went to 5.2.1+211111 and now I am at 5.2.2+211115 and the bug is still present. I also tried resetting all the themes and received the same message. | ||||
Steps To Reproduce | Steps to reproduceMake a survey (it can be blank with no questions). Expected resultThe theme is updated. Actual resultThe theme is not updated and a red banner will appear with the Datecreated is invalid error message. (See screenshot) | ||||
Tags | datecreated, survey, surveyOptions, theme | ||||
Attached Files | |||||
Bug heat | 12 | ||||
Complete LimeSurvey version number (& build) | 5.2.2+211115 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Brave/Chrome | ||||
Database type & version | Postgresql/EnterpriseDB 10.9.17 | ||||
Server OS (if known) | Windows Server 2019 Datacenter | ||||
Webserver software & version (if known) | nginx 1.20.1 | ||||
PHP Version | 8.0.12 | ||||
In the application logs, I receive "2021/12/08 17:01:43 [error] [application.LimeExpressionManager] setVariableAndTokenMappingsForExpressionManager with an empty surveyOptions." when trying to change the theme. I've also tried a few different date formats (including the removal of the creationDate xml element) in configs.xml, but nothing seems to work. |
|
We couldn't reproduce it in master with postgre. Can you try again please with the steps you provided? Is the error happening with new surveys or with pre-existing surveys? Thanks! |
|
Hi Gabriel, the error happens with new and existing surveys. I've also noticed it happens when I try to save other survey properties as well, such as settings in the Publication and Access tab (Link survey on public index page), settings in the Presentation tab (Show "There are X questions in this survey"), etc. The lime_surveys.datecreated field in our Postgresql database is a timestamp of the form YYYY-MM-DD 24H:MM:SS.fff. For example, 2021-11-11 18:11:32.000 2021-12-15 20:38:52.000 2021-11-25 23:30:14.000. I've been able to side-step the GUI error by making manual changes to the database fields thus far. |
|
Can I please ask you a screenshot of the definition of the startdate and datecreated fields in the database? Can I also ask you to add this line (temporary) on application/controllers/admin/database.php, line 922 |
|
Like this. |
|
Our thought is that somehow, the postgre DB saves the values with a precision of more than 3 digits on the timestamp. |
|
Here are the database definitions for the fields originating in the lime_surveys table. It happens on active and deactive surveys. Also, adding that line (using setFlashMessage instead of log) to database.php, we get "Trying to save with this date 11-JAN-22 23:01:46", see photo. |
|
Thanks! I think the issue is with some deault PHP/PDO option when picking up the date from the DB. |
|
Does this help? I believe it is a DB / Locale setting issue. |
|
Check the DateStyle parameter on the DB. That should be it. |
|
Running "show datestyle;" gives me "ISO, DMY" From https://www.postgresql.org/docs/9.1/datatype-datetime.html#AEN5595, it seems like this date from should work ("08-Jan-99 --> January 8, except error in YMD mode") |
|
When querying, DB is returning dates on a style which is later not accepted by the validations done on LS. Please, try changing it. "SQL, DMY" may work |
|
@gabrieljenik : https://github.com/LimeSurvey/LimeSurvey/blob/74f4ee3ee6b9632adff9a0c1bdae946f4eae4b86/application/models/Survey.php#L535 Seems rules accept 2022-01-11 23:01:28.000 ? Else : maybe need fixed when show form ? |
|
Adding "set datestyle to SQL, DMY" to the configs.php initSQLs array gives "Trying to save with this date 11/01/2022 23:01:46" with the same dateCreated error. |
|
Then, ISO should be good. |
|
@DenisChenu I don't think so. This is an issue for dates when:
Form is not involved I believe |
|
Strangely : trying to save 11/01/2022 23:01:46 must broke on SQL and MARIADB too … Else : we don't show datecreated in form … then you're right … |
|
Using 'initSQLs'=>array(..., 'set datestyle to ISO, DMY'), in config.php seems to have solved this... "ISO, DMY" is the result of "show datestyle;" but it's also what I use in initSQLs... |
|
Great! What do you mean by " I use in initSQLs"? |
|
I just meant to say that "ISO, DMY" is the same datestyle in configs.php'set datestyle to ISO, DMY' in 'initSQLs'=>array(..., 'set datestyle to ISO, DMY') and postgresql
So it's odd this changes anything, but I'm very happy this is working now! |
|
Hello mhladun, galads |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2021-11-17 15:31 | mhladun | New Issue | |
2021-11-17 15:31 | mhladun | File Added: Screenshot 2021-11-16 184347.png | |
2021-11-17 15:31 | mhladun | File Added: w.png | |
2021-11-17 15:32 | mhladun | Tag Attached: theme | |
2021-11-17 15:32 | mhladun | Tag Attached: datecreated | |
2021-11-17 15:32 | mhladun | Tag Attached: survey | |
2021-11-17 15:32 | mhladun | Tag Attached: surveyOptions | |
2021-11-17 15:40 | mhladun | Issue Monitored: mhladun | |
2021-11-17 15:40 | mhladun | Bug heat | 0 => 2 |
2021-11-17 15:43 | DenisChenu | Issue Monitored: DenisChenu | |
2021-11-17 15:43 | DenisChenu | Bug heat | 2 => 4 |
2021-11-17 15:58 | galads | Assigned To | => galads |
2021-11-17 15:58 | galads | Status | new => confirmed |
2021-11-17 15:59 | galads | Description Updated | |
2021-11-17 15:59 | galads | Steps to Reproduce Updated | |
2021-11-17 15:59 | galads | Zoho Project Synchronization | => |Yes| |
2021-12-08 17:04 | mhladun | Note Added: 67743 | |
2021-12-08 17:04 | mhladun | Bug heat | 4 => 6 |
2021-12-23 15:25 | gabrieljenik | Note Added: 67860 | |
2021-12-23 15:25 | gabrieljenik | Bug heat | 6 => 8 |
2022-01-11 16:26 | galads | Status | confirmed => feedback |
2022-01-11 17:37 | mhladun | Note Added: 67966 | |
2022-01-11 17:37 | mhladun | File Added: changing public index page setting 2022-01-11 112659.png | |
2022-01-11 17:37 | mhladun | File Added: dbeaver date created 2022-01-11 113646.png | |
2022-01-11 17:37 | mhladun | Status | feedback => assigned |
2022-01-12 13:53 | gabrieljenik | Note Added: 67969 | |
2022-01-12 13:56 | gabrieljenik | Note Edited: 67969 | |
2022-01-12 14:14 | gabrieljenik | Note Edited: 67969 | |
2022-01-12 14:14 | gabrieljenik | Note Added: 67970 | |
2022-01-12 14:14 | gabrieljenik | File Added: image.png | |
2022-01-12 14:15 | gabrieljenik | Note Edited: 67969 | |
2022-01-12 14:34 | gabrieljenik | Note Added: 67971 | |
2022-01-12 16:12 | mhladun | Note Added: 67973 | |
2022-01-12 16:12 | mhladun | File Added: image-2.png | |
2022-01-12 16:12 | mhladun | File Added: image-3.png | |
2022-01-12 16:12 | mhladun | File Added: image-4.png | |
2022-01-12 16:12 | mhladun | File Added: image-5.png | |
2022-01-12 16:54 | gabrieljenik | Note Added: 67974 | |
2022-01-12 17:07 | gabrieljenik | Note Added: 67975 | |
2022-01-12 17:11 | gabrieljenik | Note Edited: 67975 | |
2022-01-12 17:26 | gabrieljenik | Note Added: 67976 | |
2022-01-12 17:27 | mhladun | Note Added: 67977 | |
2022-01-12 17:31 | gabrieljenik | Note Added: 67978 | |
2022-01-12 17:35 | DenisChenu | Note Added: 67979 | |
2022-01-12 17:35 | DenisChenu | Bug heat | 8 => 10 |
2022-01-12 18:03 | mhladun | Note Added: 67980 | |
2022-01-12 18:03 | mhladun | File Added: image-6.png | |
2022-01-12 18:06 | gabrieljenik | Note Added: 67981 | |
2022-01-12 18:08 | gabrieljenik | Note Added: 67982 | |
2022-01-12 18:10 | DenisChenu | Note Added: 67983 | |
2022-01-12 19:27 | mhladun | Note Added: 67984 | |
2022-01-12 19:27 | mhladun | File Added: image-7.png | |
2022-01-12 19:30 | gabrieljenik | Note Added: 67985 | |
2022-01-12 19:45 | mhladun | Note Added: 67986 | |
2022-02-28 11:57 | galads | Note Added: 68420 | |
2022-02-28 11:57 | galads | Bug heat | 10 => 12 |
2022-02-28 11:57 | galads | Status | assigned => closed |
2022-02-28 11:57 | galads | Resolution | open => no change required |