Oh hello, anyone from Adobe out there? Can you please confirm whether this is a bug. I see Quick fix suggestions all the time inside a folder. Please reply.
1 person found this helpful
I am unable to reproduce this issue.
I create the folder an directory CFSelenium/selenium.cfc and put a method in it called selenium(). Then I place the following code in my index.cfm in the web root.
<cfset CFSelenium = createObject("component","CFSelenium.selenium") />
<cfset CFSelenium.selenium() />
Quickfix did not come up.
I then removed the selenium() method from the CFC and went back to the index.cfm. Quick fix came up and offered to create the function. I opted for that and it appropriately crated the method in the selenium.cfc.
Are you trying to call CFSelenium.selenium() without creating the object first?
First of all thanks for the reply. I've waited for 14 days.
I further investigated this issue and found that the preference option 'Build server settings' under server settings was off, (if I turn it on it will take long hours to index the files since the webroot is too large. I waited for that hours to pass and now I don't see quick fix suggestion).
However,the option 'Index cfcs in your projects' is turned on. Now if I have a cfm in some directory projname/folder/somecfm where in I have specified 'new CFSelenium.selenium()' then it gives out the proposal create component CFSelenium/CFSelenium/component. Is this correct? CFSelenium is my projectname.
Also, while we are on this, if a cfm under a directory has this 'new helloCFC()' (under projname/dir/cfmfile) the first suggestion provided says 'create component projname/helloCFC. This is not correct. How will CFCs get resolved at runtime. Obviously coldfusion will not be able to find the component.
I'm hope this time I get a quick reply.
If you start getting into situations where your paths will be different at runtime than they are in CFBuilder then you need to set up mappings. You need to tell ColdFusion Builder that it should be looking for the CFCs in a different place.
It has been a while since I have needed to set this up, I *think* that if you have App specific mappings that it will be smart enough to use those. Otherwise you may need to right click on the project and set up th mappings in the settings there.
I can't go about adding mappings for each and every project in my workspace. Why did CF Builder give a wrong quick fix suggestion at first place. I wouldn't call this feature 'QUICK FIX' if it expects me to add mappings for the project which are right within my web root. I would rather call it 'SLOW FIX' because it is giving me a wrong suggestion and that too the very first one. I expect at least the first suggestion to be the right suggestion.
My paths wouldn't be different at runtime, I'm using the standalone version of ColdFusion for my development and my projects are right within the webroot. CF Builder should not make any assumptions and provide quick fix suggestions.
First of all, try to calm down. I am trying to help you.
Perhaps I misunderstood what you are saying.
Quickfix is makign the right suggestions for me.
Perhaps you can do a better job of describing your webroot structure. As I recall you said your project is in a folder called CFSelenium/ and in there you have a folder called CFSelenium/ and in there you have a Selenium.CFC.
So if your workspace is in webroot/ then the path to that file is CFSelenium.CFSelenium.Selenium.
But then I thought you said that when you run the application then your path is webroot/CFSelenium/Selenium.cfc so then the component path would be CFSelenium.Selenium.
Is that the case?
I have many projects in my workspace, CFSelenium being one of them. So the project that I'm taking about is right within the webroot and has some directories in it. So if my project name is 'CFB2' and a directory in it is 'DIR1', I have my cfm in CFB2/DIR1/ and I would call the cfm file as test.cfm. Now in the cfm file if I type in new HelloCFC() then the quick fix suggestion is shown. The very first suggestion indicates that the CFC can be created under CFB2 (note: it is not the same directory within which the cfm file resides, it is directly under the project). I select the first suggestion and it happily creates a HelloCFC inside CFB2. This is not correct right? I think this is a bug, if I run the cfm page in the browser it reports the error indicating that it didn't find the CFC. I think adding mapping would certainly resolve but thats not right. I want builder not make any assumptions. I think it is not just a bug, but a basic testcase scenario. I wonder how the Engineering team missed out on that.
I'm sorry if I've been harsh on this forum, but it was not intentional. I know none of products made in this world are bug free, but this seemed like a basic test scenario for me. I'm really liking other features that I use frequently while writing applications and have no pain with that. If one has to buy CFB2, I would say buy it for the Code formatter, Quick fix (if the bugs are cleared in any possible updater) and the search where in I can do tag search and text search in all possible places I can think of. The code formatter and search are really polished ones and it has made my life a hell lot easier.
If there will be an updater, then please fix this quick fix bug quickly. Will there be an updater in first place?
When you do this:
<cfset test = new HelloCFC() />
ColdFusion Builder gives you TWO options in the quick fix. It will allow you to create the HelloCFC.cfc file in the CFB2/ folder OR in the /CFB2/DIR1 folder.
Technically, those both can be legal locations for that CFC to reside. If a mapping is in place that points "/" to CFB2/ then the first one would work, in all cases the second one would work.
ColdFusion builder has no way of knowing if you have a mapping in place for / so it offers that as a solution. You don't need to chose it, but it is a valid place to put that file based on the component path you gave it.
If you don't want to put mappings in your project, then fine, don't. But then if you want to call a statement like the one above, then you need to put your HelloCFC.cfc into the same directory as the calling CFM. So in this case, if you don't want to add a mapping, then HelloCFC.cfc needs to be in CFB2/DIR1/ right next to the index.cfm file that is trying to use it because that is where CF is going to look for it if there is no mapping.
There is no bug here. If you don't want it to creat it in CFB/ then chose the other option it gives you.
And no, it is not wrong for CFB to suggest a fix based on something that *could* be. In a dynamic environemnt like ColdFusion it cannot know everything. It is up to the developer to know where to have CFB place the file.
I forgot to ask. Where, if not in those two places, do you think CFB should put the HelloCFC.cfc file?
As I said earlier, builder should not make any assumptions. At the least it should not produce the code which is not compilable. I have repeated this several times and do not wish to continue to reply to this post because I'm tired now.
It is not possible to expect users to have mappings for all the projects in the webroot. If it is documented then it is acceptable since it would mark this as a known issue, but this is not documented anywhere. Can someone from the Adobe ColdFusion Builder Engineering team respond to this post?
You are not listening. You are not expected to add mappings to all of your projects. If you put the code in the right place it will work fine without mappings.
You can repeat yourself all you want, it doesn't make you right. Based on the component path you are giving BOTH of the locations CFB is listing are valid. One of them requires a mapping. Since ColdFusion Builder cannot know if a mapping is set up in the Administrator it cannot filter it out based on whether or not the mapping exists.
These are the Adobe communtiy forums, they are for the community. The engineers do not typically reply to messages in here. If you want to report this as a bug and hear back from an engineer, you need to do so in the appropriate place. But since this is not a bug, I doubt you will the "fix" you think you need.
You are getting angry over your own misunderstandings of how this, and ColdFusion, work. I don't know what else to tell you. I'm sorry that you are feeling so tired over it, but this is not a problem with CFB, it is a problem with your understanding of how it should work.
One more thing. That component path is also legit if the application is being run from the webroot, regardless of mappings.
Logged bug 2879858, let's see what Adobe has to say.
I have added my opinion to the ticket.