Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Why are some config.json files duplicated Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
tigertech
Newbie
Newbie


Joined: 21 November 2019
Online Status: Offline
Posts: 23
Posted: 16 November 2021 at 3:41pm | IP Logged Quote tigertech

In some cases, a config.json file appears in two places -- in "modules/*/config.json" and again in "data/settings/modules/*.config.json".

The contents are usually almost the same, but not quite -- for example, in version 9.2, "modules/MailWebclient/config.json" contains:

Code:

        "AllowSearchMessagesBySubject": [
                false,


... but "data/settings/modules/MailWebclient.config.json" contains:

Code:

    "AllowSearchMessagesBySubject": [
        true,


Is that intentional, and if so, under what circumstances are the two different files used?

(I noticed this because I have a system that modified "modules/MailWebclient/config.json" in versions before 8.6, but the changes stopped working in version 8.6 when the second file appeared. It seems now I have to put the changes in "data/settings/modules/MailWebclient.config.json".)
Back to Top View tigertech's Profile Search for other posts by tigertech
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 16 November 2021 at 10:42pm | IP Logged Quote Igor

Configuration files under modules/ contain default configuration settings. It's recommended to make changes only to files under data/modules/ directory. Configuration files under modules/ are only used if there's no file found under data/modules/ directory.

The purpose of "Update configuration" button in Database Settings screen of adminpanel is to create configuration files under data/modules/ directory for all the modules, that's something that needs to be done after a fresh install or when upgrading from a previous version - for example, if a new module is introduced in the new version.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 
tigertech
Newbie
Newbie


Joined: 21 November 2019
Online Status: Offline
Posts: 23
Posted: 17 November 2021 at 8:48am | IP Logged Quote tigertech

Thanks, that makes sense.

I guess I was mostly confused about why the two files have different settings between the modules and data versions in the initial "webmail-pro-php.zip" distribution of the files, but some of the settings in the modules version were never used.

When I deleted the data version as a test and clicked "Update configuration", a new version of the file was created (as I expected) -- but with different settings than what looked like the "default" settings in the modules version.

Now that I look closer at how the code works, I see that when I click "Update configuration", it copies the modules version to data if it doesn't exist, but only after first altering the file by making changes seen in pre-config.json.

I'm not sure why that extra step is there instead of having the desired defaults in the original modules version, but anyway, that explains it, and my question is answered. Thanks!
Back to Top View tigertech's Profile Search for other posts by tigertech
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 17 November 2021 at 11:19am | IP Logged Quote Igor

Oh that's right, I forgot to mention pre-config.json file. The reason for that file is, config.json values in the file are stored in repository of the particular module, but when building the product, we need a more fine-grained control over the default values, that's why pre-config.json is introduced - changing defaults in the module itself isn't really feasible as the same module is reused by multiple products and the behavior may differ between those.

--
Regards,
Igor, Afterlogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide