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

THIS.mappings - scoping problem?

Explorer ,
Apr 21, 2012 Apr 21, 2012

hi there

our Application.cfc contains

  THIS.mappings = StructNew();

  mappingname = "/webincludes";

  mappingpath = "Z:\webincludes\movo";

  THIS.mappings[mappingname] = mappingpath;

Calling

    <cfinclude template="/webincludes/vowiz/myinclude.inc" >

from within the function onRequestStart() works fine.

But when we try to do the same from a normal cfm-template, we get a

   Could not find the included template /webincludes/vowiz/myinclude.inc

Is this a scoping problem? And how can we overcome it? I actually thought, that mappings are visible all over the application?

-Didi

1.2K
Translate
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

correct answers 1 Correct answer

Explorer , Apr 22, 2012 Apr 22, 2012

you may just trash this thread !!!!

For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

before the cfinclude - who wonders it has forgotten the mappings

Sorry for bothering, unfortunately I cannot delete the thread - maybe an admin will do so. It's not worth to keep.

-Didi

Translate
Explorer ,
Apr 22, 2012 Apr 22, 2012

you may just trash this thread !!!!

For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

before the cfinclude - who wonders it has forgotten the mappings

Sorry for bothering, unfortunately I cannot delete the thread - maybe an admin will do so. It's not worth to keep.

-Didi

Translate
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 ,
Apr 22, 2012 Apr 22, 2012

For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

before the cfinclude - who wonders it has forgotten the mappings

Didi, was it you that was asking about source control the other week?  This is another case in point wherein using source control & separate working copies rather than just hacking the code directly is beneficial: your co-worker can mess up the code as much as they like, and provided they don't commit their mess (at which point you're allowed to shoot them ;-), their mess does not affect you.

--

Adam

Translate
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
Explorer ,
Apr 22, 2012 Apr 22, 2012

Hi Adam

yes, that was me.

However, in this case SC would not have been successful. He was working all on his own on that part of the project and just asked me for help. I did not see the flaw at the first view.

But we have heard the bells and are looking into SC

-Didi

Translate
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 ,
Apr 22, 2012 Apr 22, 2012
LATEST

Didi wrote:

you may just trash this thread !!!!

For some debugging purposes, my co-worker had included an ApplicationStop() a couple of lines

before the cfinclude - who wonders it has forgotten the mappings

Sorry for bothering, unfortunately I cannot delete the thread - maybe an admin will do so. It's not worth to keep.

Didi, it would be shame to delete this thread. It asks a question which many developers confront, provides a solution and is well presented. I do believe it will help others in future.

Translate
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