View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
17346 | Bug reports | Question editor | public | 2021-05-31 14:58 | 2023-09-13 15:19 |
Reporter | gabrieljenik | Assigned To | |||
Priority | normal | Severity | partial_block | ||
Status | acknowledged | Resolution | open | ||
Product Version | 5.x | ||||
Target Version | 5.0.0dev | ||||
Summary | 17346: Personal setting default question type is ignored when creating questions | ||||
Description | When selecting a default question type, ex shortfreetext, the array question type is shown as the selected question type. This only happens with the simple selector. | ||||
Steps To Reproduce |
| ||||
Additional Information |
We believe the "setting as core" should be not on the model. | ||||
Tags | No tags attached. | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 5.0 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Mysql | ||||
Server OS (if known) | |||||
Webserver software & version (if known) | |||||
PHP Version | 7 | ||||
related to | 17310 | closed | gabrieljenik | Simple question type selector didn't open with the current question type |
Are you sure it's saved ? Last time i check : nothing seems saved on user settings. |
|
Yes, that's what we are seeing |
|
Yes, see the other mantis after (i think i already reported it :( ) |
|
Somehow there is a missmatch in between the core question theme and the names of the core question themes. |
|
Question themes have a name, like 'arrays/array' or 'bootstrap_buttons'. Some parts of Lime only handle the question themes by name, and treat the core themes as "core" (instead of by their name). For example, when handling question attributes, it's usually done by question type and question theme name, and 'core' is used as theme name for the basic ones. The specific problem with this ticket is that question type/theme metadata for the selected question (to mark the selected question type/theme in the selector) is retrieved with QuestionTheme::findQuestionMetaData(), which returns the "real" question theme data, including the saved name. It's temporarily solved in T656 by replacing the theme name after retrieving the metadata. Alternative better approaches follow: Alternative A) Make the replacement inside findQuestionMetadata(). Other parts of Lime using that function don't rely on the theme name, so it wouldn't have an impact. But, the function is public, so it may be used by third party code. Alternative B) Make a clone of findQuestionMetadata() adapted for returning "core" sometimes. Alternative C) Review the usage for findAllQuestionMetaDataForSelector() and make it match to findQuestionMetadata(). Thoughts? @ollehar |
|
Young code, out of any API : don't really care, no ? If you think of « it may be used by third party code» : you don't create i10n function like this. |
|
Can you give some example where this happens? There might be a hack present, not sure. There are three types of question themes:
Whenever you see "core", the variable should probably be called $questionThemeType. |
|
Just a NB about "findQuestionMetadata" - this function shouldn't exist. It should be $question->question_theme->config->metadata. Questions have no metadata, only question themes do (and all other extensions like survey theme and plugins). There's some conceptual confusion here I want to sort out together with Patrick as soon as he's finished with encryption (again). |
|
About "findAllQuestionMetaDataForSelector", not sure this should exist either. :) More like array_map($questions, function($q) { return $q->question_theme->config->metadata; }); Much could fall into place if we add a new class Metadata and a method "getMetadata" to ExtensionConfig class. About this line:
This is a sign of lack of abstraction between view, logic and data. There should be a method "getSettings" that does the conversion. Actually, settings should not be part of metadata at all, because metadata should be identical between all extension types (plugins etc). Again some domain confusion. This lack of separation is throughout the entire question theme system, sadly. |
|
Possibly a new class QuestionThemeExtensionConfig extending ExtensionConfig could have method getSettings. |
|
From Olle: |
|
Waiting for #17350 to be finished to reassess this |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2021-05-31 14:58 | gabrieljenik | New Issue | |
2021-05-31 15:01 | DenisChenu | Relationship added | related to 17310 |
2021-05-31 15:03 | DenisChenu | Note Added: 64672 | |
2021-05-31 15:08 | gabrieljenik | Additional Information Updated | |
2021-05-31 15:08 | gabrieljenik | Sync to Zoho Project | Yes => |Yes| |
2021-05-31 15:09 | gabrieljenik | Note Added: 64674 | |
2021-05-31 15:13 | DenisChenu | Note Added: 64675 | |
2021-05-31 15:17 | gabrieljenik | Note Added: 64676 | |
2021-06-01 10:04 | ollehar | Product Version | => 5.x |
2021-06-01 10:04 | ollehar | Sync to Zoho Project | Yes => |Yes| |
2021-06-01 19:53 | ollehar | Priority | none => normal |
2021-06-01 19:53 | ollehar | Sync to Zoho Project | Yes => |Yes| |
2021-06-03 16:22 | gabrieljenik | Assigned To | => gabrieljenik |
2021-06-03 16:22 | gabrieljenik | Status | new => assigned |
2021-06-07 17:42 | gabrieljenik | Note Added: 64770 | |
2021-06-07 17:49 | DenisChenu | Note Added: 64771 | |
2021-06-14 17:06 | ollehar | Note Added: 64898 | |
2021-06-14 17:09 | ollehar | Note Added: 64899 | |
2021-06-14 17:10 | ollehar | Note Edited: 64899 | |
2021-06-14 17:10 | ollehar | Note Edited: 64899 | |
2021-06-14 17:16 | ollehar | Note Added: 64900 | |
2021-06-14 17:18 | ollehar | Note Edited: 64900 | |
2021-06-14 17:18 | ollehar | Note Edited: 64900 | |
2021-06-14 17:19 | ollehar | Note Added: 64901 | |
2021-06-14 17:22 | gabrieljenik | Note Added: 64902 | |
2021-07-05 17:39 | gabrieljenik | Status | assigned => acknowledged |
2021-07-05 17:39 | gabrieljenik | Note Added: 65205 | |
2023-09-13 15:19 | gabrieljenik | Assigned To | gabrieljenik => |