SOLVED Question regarding order in which dynamicui files get loaded and applied

Operating System & Version
CentOS 7
cPanel & WHM Version
98.0 (build 1)

sangeeths

Active Member
May 25, 2021
25
7
78
India
cPanel Access Level
Root Administrator
The documentation at Guide to cPanel Plugins - The dynamicui Files · cPanel & WHM Developer Portal mentions the load order of dynamicui files. I had a question regarding this specific line:

Code:
/usr/local/cpanel/base/frontend/theme/dynamicui/dynamicui_*.conf
Out plugin currently generates the files with a suffix described as best practice in here. We add multiple files (have our own internal module system which determines these files). In what order does the wildcard pattern load and activate the files? And does having the same group/items in the latter loaded files override the ones from earlier? Could that be clarified in the docs as well?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,562
2,611
363
cPanel Access Level
Root Administrator
Hey there! I reached out to the UI team about this and there wasn't a consensus on how those would be loaded. I've created a case for the team to research this behavior, but I can't say for sure how long it will be before I hear back on that.

I can say for sure that the latter items will override previous items.

I'll be sure to update this thread once I get more details.
 
  • Like
Reactions: sangeeths

sangeeths

Active Member
May 25, 2021
25
7
78
India
cPanel Access Level
Root Administrator
Hey there! I reached out to the UI team about this and there wasn't a consensus on how those would be loaded. I've created a case for the team to research this behavior, but I can't say for sure how long it will be before I hear back on that.

I can say for sure that the latter items will override previous items.

I'll be sure to update this thread once I get more details.
Thanks a ton, would really appreciate clarity on this and looking forward to it.
 
  • Like
Reactions: cPRex

sangeeths

Active Member
May 25, 2021
25
7
78
India
cPanel Access Level
Root Administrator
@cPRex correct me if I'm wrong anywhere in the following bits and apologies in advance if I'm pasting code that's not meant to be pasted.

So, I did some perusing of the cPanel code and found this in our /usr/local/cpanel/Cpanel/DynamicUI/Loader.pm:

1632740322150.png

This seems like part of the logic of processing custom dynamicui files (let me know if that's not the case) and it seems like the files are being processed by cPanel based on the listing returned by the readdir function. And after checking docs/googling, it seems like the order in which the listing is returned is platform-dependent. In our case, we stumbled on an ordering issue again and after toying around with file names and other parameters, the precedence seems to be based on mtime of the files (i.e, the latest wins) on our v98 CentOS installation.

But, in either case, I guess we shouldn't bet on that?