Skip to content

Conversation

@labkey-klum
Copy link
Contributor

Rationale

Adds the list of active folders for each module to the core.modules table.

image

Initially I tried a query based solution but I don't think it reports the complete set of active modules per container and misses ones that might be available via folder types etc. Instead I went with a java solution asking the container for it's list of active modules.

Here's the query I tried initially:

        PropertySchema.getInstance().getTableInfoProperties();
        // find the folders that the module is active in, I don't think this is entirely accurate.
        SQLFragment moduleFolders = new SQLFragment("(SELECT PROP.name AS module, ")
                .append(getSqlDialect().getGroupConcat(new SQLFragment("C.path"), true, true, "\n")).append(" AS folder FROM ")
                .append(PropertySchema.getInstance().getTableInfoPropertySets(), "PS")
                .append(" JOIN ").append(PropertySchema.getInstance().getTableInfoProperties(), "PROP")
                .append(" ON PS.set = PROP.set")
                .append(" JOIN ").append(CoreSchema.getInstance().getTableInfoContainerPath(), "C")
                .append(" ON PS.objectId = C.entityid")
                .append(" WHERE PS.category = 'activeModules'")
                .append(" GROUP BY PROP.name")
                .append(") AF");

        ret.append("JOIN ").append(moduleFolders).append(" ON AF.module = m.name ");

@labkey-klum labkey-klum self-assigned this Dec 22, 2025
Copy link
Contributor

@labkey-adam labkey-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed code and did a quick manual test... looks good.

You could revert whitespace changes to core-create.sql files, but whatever.

@labkey-klum labkey-klum merged commit 9df1374 into develop Dec 24, 2025
6 checks passed
@labkey-klum labkey-klum deleted the fb_module_folders branch December 24, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants