View Issue Details

IDProjectCategoryView StatusLast Update
0005607Composrcore_configurationpublic2024-03-30 14:51
ReporterAdam EdingtonAssigned ToPatrick Schmalstig 
SeverityFeature-request 
Status assignedResolutionopen 
Product Version 
Fixed in Version 
Summary0005607: Allow configuration options set to their defaults to dynamically change when the default changes
DescriptionCurrently, the configuration system will read in the default value if not set and fill it in the form field. Then, when the form is saved, that value is explicitly set for the configuration option.

This is not ideal for some fields, especially those whose default value is based on a language string.

Instead, if a config option is saved and its value matches that of the default, it should be saved as some implicit value indicating it was marked as default. And when reading in config values, those whose value matches this magic default will instead load in the value of get_default().

This will allow config options to change according to new default values when defaults change in Composr if the config option was set to the default. For example, if a language string was edited, its respective config option would use that new text if it were set to default.
Additional InformationFrom Chris:

It would need doing carefully. IIRC We have a field c_set, so you could set c_set=0 if it is just the same as the default. The actual value would still be copied in to the table as cached. You'd then need a new function that clears out cached values (values where c_set=0). You'd call that when lang files are edited.
TagsRoadmap: Over the horizon
Time estimation (hours)
Sponsorship open

Relationships

related to 0005604 closedPatrick Schmalstig Tickets language is hardcoded 

Activities

Patrick Schmalstig

2024-02-11 04:21

administrator   ~0008329

Last edited: 2024-02-11 04:23

View 3 revisions

The method presented by Chris would need additional consideration. If the default value is changed, then it would no longer match the "cached" value in the database, and by this logic, Composr would believe the config option is not supposed to be default (and thus would use the old value). We could implement a clearing out when a language string is changed, but this would only work for options which use language strings as defaults. This would not work if, say, an integer's default value changed in the hook.

We should also consider if we want this behaviour in the first place for non-lang-string config options.

Patrick Schmalstig

2024-02-11 04:25

administrator   ~0008331

Changing the reporter to Adam even though I made the issue... Adam made the original issue which prompted this issue (5604). And I'm assigning him as reporter so he gets proper credit on the logs for inspiring this.

Issue History

Date Modified Username Field Change
2024-02-11 04:19 Patrick Schmalstig New Issue
2024-02-11 04:19 Patrick Schmalstig Status non-assigned => assigned
2024-02-11 04:19 Patrick Schmalstig Assigned To => Patrick Schmalstig
2024-02-11 04:19 Patrick Schmalstig Tag Attached: Roadmap: v11
2024-02-11 04:21 Patrick Schmalstig Note Added: 0008329
2024-02-11 04:22 Patrick Schmalstig Relationship added related to 0005604
2024-02-11 04:23 Patrick Schmalstig Note Edited: 0008329 View Revisions
2024-02-11 04:23 Patrick Schmalstig Note Edited: 0008329 View Revisions
2024-02-11 04:25 Patrick Schmalstig Reporter Patrick Schmalstig => Adam Edington
2024-02-11 04:25 Patrick Schmalstig Note Added: 0008331
2024-03-30 14:51 Patrick Schmalstig Tag Detached: Roadmap: v11
2024-03-30 14:51 Patrick Schmalstig Tag Attached: Roadmap: Over the horizon