• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion per application mapping randomly fails

Explorer ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

In my application.cfc file I have the following code:

this.mappings["/includes"] = "#expandPath('../../priv/inc/')#";

and then on a page I have the following CF include set up:

<cfinclude template="/includes/imageOptimise-thumbnail.cfm">

For the majority of the time when the page is submitted the imageOptimise-thumbnail page runs without any issue but occasionally it will error saying that it can't find the imageOptimise-thumbnail.cfm. If I resubmit the page, chances are it will work but the question is, why is it sometimes not being able to find the page?

I had a look in the CF Admin and I can't see anything in the logs saying that there was an error but it is clearly showing a Coldfusion 'template not found' error message when it fails.

Anyone got any ideas?

Views

322

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

We've been suffering from this for ages, and I have not found a solution for it.  Our org inbox is inundated with emails triggered when the header.cfm page cannot be found.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

LATEST

Does adding the runonce attribute help? Assuming you're on ColdFusion 10 or above, the syntax is

<cfinclude template="/includes/imageOptimise-thumbnail.cfm" runonce="true">

Oh, and just an aside, I would avoid using a dash in a CFML file name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation