View Issue Details

IDProjectCategoryView StatusLast Update
17392DevelopmentOtherpublic2026-11-20 14:39
Reporterollehar Assigned To 
PrioritynoneSeverityminor 
Status acknowledgedResolutionopen 
Summary17392: Object reification: Create classes MetaData and QuestionThemeMetaData
Description

Lots of logic can be moved to such a class, e.g. from method getQuestionMetaData in QuestionTheme

Current state (November 2026):

  • QuestionTheme::getQuestionMetaData() still returns an associative array (it has a @todo "Replace assoc array with DTO"). It does many things at once: it reads and parses config.xml, runs a database query to find "extends" (one query per theme when all themes are scanned), decides core/custom/user from the folder, resolves the preview image path and builds the settings JSON.
  • QuestionTheme::getMetaDataArray() then maps the XML keys to database columns (it has a @todo for a DTO with toArray()).
  • ExtensionConfig is already a thin wrapper around an extension's config.xml (getters, validate(), loadFromFile()) and QuestionThemeInstaller already uses it. It can be the generic "MetaData" class, so we do not need a separate MetaData base class.

Proposed approach:

  1. Add a QuestionThemeMetaData class, built from ExtensionConfig plus the theme folder path, with typed getters for the question theme fields.
  2. Move the parsing, theme kind detection, image path and settings logic into it. Add toArray() / toDbAttributes() to replace getMetaDataArray().
  3. Move the "extends" lookup out of the metadata class (it depends on the database, not on the XML) and run it once in getAllQuestionMetaData() instead of once per theme.
  4. Keep getQuestionMetaData(), getAllQuestionMetaData() and getMetaDataArray() as deprecated wrappers, because Update_442, unit tests and possibly plugins call them.
  5. Extend QuestionThemePathTest.

Target branch: develop-minor (backward-compatible internal refactor). Low priority, no user-visible change.

TagsNo tags attached.

Users monitoring this issue

There are no users monitoring this issue.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-06-25 13:37 ollehar New Issue
2021-06-25 13:37 ollehar Summary Create classes MetaData and QuestionThemeMetaData => Object reification: Create classes MetaData and QuestionThemeMetaData
2021-07-02 11:23 ollehar Sync to Zoho Project => |Yes|
2021-07-02 11:23 LimeBot Zoho Projects ID => 85781000001011001
2022-03-31 11:47 galads Zoho Project Synchronization Yes =>
2022-03-31 11:47 galads Zoho Projects ID 85781000001011001 =>
2026-11-19 22:50 c_schmitz Status new => acknowledged
2026-11-20 14:37 c_schmitz Project Bug reports => Development
2026-11-20 14:38 c_schmitz Product Version 5.x.0-dev =>
2026-11-20 14:38 c_schmitz Description Updated
2026-11-20 14:39 c_schmitz Description Updated