CFINCLUDE allowed extensions don't allow cfc in Lucee 6.2.1

I have legacy website that was running on ColdFusion, I am shifting it lucee and facing the issue like most of the includes using CFC files and in CF admin, we were adding allowed extension as cfc also. But in Lucee, I didn’t find any settings or not even found this thing in server xml file.

Can you please let me know is it available in Lucee or no?

Don’t forget to tell us about your stack!

OS: UBUNTU
Java Version: ???
Tomcat Version: ???
Lucee Version: LUCEE 6.2.1 122

Welcome to Lucee!

you can include a demo.html with some cfml in it and lucee will execute it

the server config only has to do with which initial request urls are going to be handled by Lucee, cfinclude will just include whatever file you specify

I just tried doing this with a cfc, bit odd how it works, if you dump out the variables scope after including it, you’ll see the functions from the cfc in the variables scope?

image

include.cfm

<cfscript>
 include "include.html";
 include "include.cfc";
 dump(variables);

 init();
</cfscript>

include.cfc

component {
	function init(){
		echo("I'm in a cfc!" & getCurrentTemplatePath())
	}
}

include.html

<cfscript>
	echo("include.html" & now());
</cfscript>

Thanks for the reply, In CFC file actually they have the html and also some cfm logic as well but not functions.

What I understand from your reply, you are saying call init() function if I got right. but I have cfoutput inside cfc file and it’s in some files are html and in some are cfm basic logic not functions.

What does ACF do when you include a cfc, which method gets run?

Some example code and output would really help…

Here’s an old post from @AdamCameron about this back in 2013

Sorry Zac for late,
I created a test folder with test cfc as it was in live server. from included CFC, the legacy application is printing html and text but it says invalid syntax on , even if I remove tag and there is plan html, it’s still showing incorrect syntax.

Directory structure:
–index.cfm
----includes
------header.cfc

Here is the code from index.cfm

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>
		Test CFC Include
	</title>
</head>
<body>

		<cfinclude template="./includes/header.cfc">


</body>
</html>

Here is header.cfc

<cfoutput>
	<p>Hello, I'm from header</p>
</cfoutput>

Output is attached with screenshots:

o

In Coldfusion admin, there is a setting called CFInclude allowed extensions, and when legacy application client add cfc in that list, it worked fine.

well, that’s not really a .cfc is it? It’s a plain old .cfm file

a cfc requires a <cfcomponent> or a component {...

So just rename the file?

ps, i thought you were using 6.2.1? that exception is from 5.4.0.80

1 Like

on server we are using 6.2.1.122 but and I was not able to provide the code from server so i recreated on my local.
it’s a plain html but it also have other logic on server like cfif etc., and as the application is wide and have many files with cfc that actually needs to be cfm but we cannot update there.

As CF Server provide functionality to process cfc file, do you guys have any setting?

Alas, we don’t have any override for that

Just write a quick cfml script which

  1. directorytList all cfc files
  2. read the file content and report back out cfc file which doesn’t contain the word component
  3. rename and edit any references to those files