I found a very strange behavior in FW/1. Please use Hello3 example to
reproduce it.
#1. Add following file
hello3/views/main/myView.cfm, with following content
-------------------------------
This is my view.
-------------------------------
#2. In hello3/controllers/main.cfc, in default method, after
"name.default" service call, add following lines:
-------------------------------
variables.fw.setView("main.myView");
myVariable = myUndeclaredVariable;
-------------------------------
#3. Go do hello3/?reload=true , page will load OK (line myVariable =
myUndeclaredVariable was disregarded) and you will see "This is my
view." on the screen.
#4. Comments out variables.fw.setView("main.myView"); line and reload
the page. Now, as expected, you are getting an undeclared variable
error (after you will add error.cfm view).
So, basically, if you call setView framework method and have an
exception after the method call, this exception is completely hidden.
Can somebody explain me why it is happening...? It seems completely
weird. I took a look at setView function, it is pretty simple, just 3
lines of the code...
On Tue, May 8, 2012 at 3:17 PM, Alex Purice <alexei.pur...@gmail.com> wrote:
> Hello,
> I found a very strange behavior in FW/1. Please use Hello3 example to
> reproduce it.
> #1. Add following file
> hello3/views/main/myView.cfm, with following content
> -------------------------------
> This is my view.
> -------------------------------
> #2. In hello3/controllers/main.cfc, in default method, after
> "name.default" service call, add following lines:
> -------------------------------
> variables.fw.setView("main.myView");
> myVariable = myUndeclaredVariable;
> -------------------------------
> #3. Go do hello3/?reload=true , page will load OK (line myVariable =
> myUndeclaredVariable was disregarded) and you will see "This is my
> view." on the screen.
> #4. Comments out variables.fw.setView("main.myView"); line and reload
> the page. Now, as expected, you are getting an undeclared variable
> error (after you will add error.cfm view).
> So, basically, if you call setView framework method and have an
> exception after the method call, this exception is completely hidden.
> Can somebody explain me why it is happening...? It seems completely
> weird. I took a look at setView function, it is pretty simple, just 3
> lines of the code...
Not sure why formatting is screwed up, I just created account at
github, so no much experience with github.
BTW. I'm trying to find time to write "FW/1 for Fusebox developers"
article in a form of framework comparison and series of "How tos". But
I'm not sure on ETA.
On May 8, 4:09 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> Sounds like the error view is overridden in the presence of setView().
> Bug. Please create an issue on github with repro details.
> Thank you!
> Sean
> On Tue, May 8, 2012 at 3:17 PM, Alex Purice <alexei.pur...@gmail.com> wrote:
> > Hello,
> > I found a very strange behavior in FW/1. Please use Hello3 example to
> > reproduce it.
> > #1. Add following file
> > hello3/views/main/myView.cfm, with following content
> > -------------------------------
> > This is my view.
> > -------------------------------
> > #2. In hello3/controllers/main.cfc, in default method, after
> > "name.default" service call, add following lines:
> > -------------------------------
> > variables.fw.setView("main.myView");
> > myVariable = myUndeclaredVariable;
> > -------------------------------
> > #3. Go do hello3/?reload=true , page will load OK (line myVariable =
> > myUndeclaredVariable was disregarded) and you will see "This is my
> > view." on the screen.
> > #4. Comments out variables.fw.setView("main.myView"); line and reload
> > the page. Now, as expected, you are getting an undeclared variable
> > error (after you will add error.cfm view).
> > So, basically, if you call setView framework method and have an
> > exception after the method call, this exception is completely hidden.
> > Can somebody explain me why it is happening...? It seems completely
> > weird. I took a look at setView function, it is pretty simple, just 3
> > lines of the code...
> BTW. I'm trying to find time to write "FW/1 for Fusebox developers" > article in a form of framework comparison and series of "How tos". But > I'm not sure on ETA.
I did some initial stuff on that topic about a year ago. Feel free to use it if it helps.
IMHO, the biggest difference between FW/1 and Fusebox, is FW/1 really wants you to do things in a certain way where as Fusebox is more free form. As a result, if you have everything in the right spot, it just works. in the Fusebox world, there is a lot more spelling things out.