CF 2021 Administrator. Missing submenu items on admin pages

I’ve noticed an issue with CF 2021 CF Admin. The menu items for the Debugging page (as an example) are not showing up at the top of the screen. Just blank white spaced bordered in blue. The issue is that CF Admin believes the script files (like cfform.js) are in CFIDE/scripts. However, that directory in the CommandBox install does not exists. The files are in the cf_scripts/scripts directory. I tried setting up a mapping. I was not successful in this approach. I tried adding an alias to the local.json file. This, too, was not successful. Lastly, I simply create a new folder (scripts) under the CFIDE folder and copied the cf_scripts/scripts directory to it. Presto! Now I have the navigation options at the top of the screen for each CF Admin section. The question is: Is that a good workaround or was this something that needs to be addressed higher up the ladder? Have you noted this issue?

Are you using CFConfig, and if so, do you have a custom scripts folder setting in there. I’m pretty sure I’ve seen people with this issue when they import config from an older version of Adobe that forces the old script location.

Even though there is no real CFIDE folder, CommandBox has a special handling in its resource manager that will fulfill any requests to /CFIDE/foo or /cf_scripts/foo with the corresponding folder that exists in the root of the war. The question here is whether your HTML page is using the wrong path for the assets, or if the asset path is correct, and just not resolving to the right files on disk.

Since you’re on 2021, I’m pretty sure that means your files SHOULD be under cf_scripts, and the fact that the HTML source points to /CFIDE is why I would first check for an invalid CFConfig setting being loaded.

Thanks! Yes, I do have a cfconfig file. I’m running an instance of CF11 and an instance of CF2021 with the same cfml/cfc/html code. So, the config file is for CF11. I believe this “CFFormScriptDirectory”:"/CFIDE/scripts/" is what is causing the issue. I’m going to read some today. What I’m looking to find out is can I run both CF versions with same web application code?

The HTML in question is the CF 2021 Administrator code. The code is pointing to the CFIDE/scripts folder. I tried to update the default in the CF 2021 Admin settings page. But, it would not save. The needed script files are indeed under cf_scripts, but that is not where the Administrator code is referencing them.

@bdw429s - The core issue @rbryant is related to transitioning back and forth between a CF11 and CF2021 using .cfconfig file. Would you recommend we use 2 cfconfig files, e.g. .cfconfig.cf11 & .cfconfig.cf2021 and then write a recipe to copy the desired cfconfig file before starting the server? (note: assuming we fix cfconfig for CF2021 1st)

p.s. The Goal is to allow the team to move back and forth b/w CF11 & CF2021, via Commandbox, as they fix, remediate, replace, etc code during the migration process.

I would recommend just trying to remove that setting from your JSON entirely. The correct default setting is most likely going to come packaged in the war to begin with.

Um, what does that mean :slight_smile: Did you get an error? Did the value revert to someting else? What eactly about it, “didn’t save”?

Well yes, obviously. That’s the whole issue. You’ve told CF to look elsewhere for them.

No, that sounds like a lot more work. Like I suggested above, I’d just remove the setting from your JSON file and both engines should just default to the correct thing.

On a related note, I was just thinking about having a convention inside your server.json to declare ad-hoc env vars for a server. This would be a usecase for something like that as each server could set an env var used in your JSON expansions, or for that matter, just set the setting directly. But n reality, I don’t think you need any of that here. Just remove the setting.

Also, note these new CFConfig features related to helping you export and import just the setting you need:

1 Like

Thank you. That worked. I appreciate your prompt feedback.

I know you didn’t need this feature, but after thinking about it above and it being in my mind for a while, I went ahead and implemented it:

https://ortussolutions.atlassian.net/browse/COMMANDBOX-1362

If you ever have the need again to override a CFConfig setting for a single server, can be done like so (in CommandBox 5.4.0) with an ad-hoc env var that’s specific to the server.json file.

{
    "env":{
        "cfconfig":{
            "CFFormScriptDirectory":"/foo/bar/"
        }
    }
}

Thanks for the heads up! I had tried something similar in concept yesterday when starting the server: server start name= CFFormScriptDirectory=.

That’s not valid though. You can’t control any CF settings via start parameters. You can see all the valid start params in the command help

server start ?

No question about it. At the time, however, I was just trying it out to see if it would work. I’m still acquiring knowledge on CommandBox and I was trying to guess at how it might be done.