Our Forums are now closed. Please go to our Google Mailing List for help. This site will remain open for historical purposes.
ColdBox Framework Forums Home | Profile | Search | Login | RSS

 pdf Print PDF   Previous Page  Page: 1   Next Page

Thread: Problem with layout folders / CF9
Created on: 02/03/10 10:26 AM Replies: 14
cftagger
Corporal

Joined: 10/06/09
Posts: 24
Problem with layout folders / CF9
02/03/10 10:26 AM

I've just installed Coldbox 3, M4 on a CF9 server. Unfortunately, I'm expieriencing problems with the layouts. In Coldbox.cfc, I have the following section:

layouts = {
ajaxviews = {
file = "Layout.Ajax.cfm",
folders = "admin/ajaxviews"
},
adminLayout = {
file = "Layout.Admin.cfm",
folders = "admin"
}
};

In my event handler, I set the view by doing
<cfset Event.setView("admin/ajaxviews/vwAjaxResults") />

Unfortunately, the "Layout.Admin.cfm" is taken, NOT "Layout.Ajax.cfm" as it should be (because of the folder "admin/ajaxviews").

The same application works on a CF8 box, but fails on CF9.

Any ideas?
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
02/03/10 6:17 PM

Is the problem in cf8 vs cf9 or between xml and cfc loader?
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
02/04/10 12:31 PM

I think, it's cf9; the application code is the same on both servers. Both also running M4. And both with Coldbox.cfc not xml.
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
02/04/10 2:07 PM

I am going to need your help on this so please investigate what can cause this. I suggest looking at the setview code first and let me know
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
02/04/10 2:59 PM
Attachment: cf9LayoutBug.zip

Luis,
Find attached a very sample app. I just took the Application template and modified it. It has two links, that execute myEvent1 and myEvent2.

myEvent1 has a setView("admin/view1") that should trigger the "Layout.Admin.cfm".

myEvent2 has a setView("admin/ajaxviews/view2") that should trigger the "Layout.Ajax.cfm".

On cf8, all is fine, but on cf9, the "Layout.Ajax.cfm" is not triggered clicking on "event2"; the "Layout.Admin.cfm" is taken...
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
02/12/10 2:06 AM

Did anybody try the sample code on a cf9-box? Did it work as it should?
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
02/12/10 2:29 AM

Sorry my friend, I have not gotten to it yet.
Luis Majano
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
02/12/10 10:37 AM

I found the issue and don't know how to approach it.

The issue is that the folders are embedded within each other and the order is an issue. In cf8 the internal ordering is with the internal structures, but maybe it changed in cf9.

Basically, the structure declaration is not linked but ordered internally.

If this was a declared array then it might take things in order. I will have to thing about this.

Also remember that the folder strings are regular expressions too
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
02/15/10 2:36 AM

So, what would you recommend? Wait till M5 (you think, it'll be ok then)? Or not to nest view-folders? i.E; put the "ajaxviews"-Folder out of the admin-folder to the top-view-folder?
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
02/15/10 11:43 PM

Yea as of now the layout settings will have to change to array notation so it can support in order of necessary. I will create a ticket forthis
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
03/10/10 6:47 AM

Any news on this issue? I couldn't find any ticket for this. Chances that this will befixed in M5? Any approx. release date for M5?
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
03/10/10 11:03 AM

Hi,

I have not forgotten about this. Just haven't had time to add it, but yes, this is an issue where you will define the layouts in array notation instead of structure notation so you can give priority ordering.
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
03/12/10 4:02 AM

Could you help me how to convert

layouts = {
ajaxviews = {
file = "Layout.Ajax.cfm",
folders = "admin/ajaxviews"
},
adminLayout = {
file = "Layout.Admin.cfm",
folders = "admin"
}
};

to the array notation?

I've tried this:

layouts = StructNew();
layouts["ajaxviews"] = { file="Layout.Ajax.cfm", folders="admin/ajaxviews" } ;
layouts["adminLayout"] = { file="Layout.Admin.cfm", folders="admin" };

But still doesn't work...?
Link | Top | Bottom
lmajano
Veteran Master

Joined: 01/29/05
Posts: 1209
RE: Problem with layout folders / CF9
03/12/10 3:46 PM

Will commit tonight, but you can now define the layouts as a struct (no order) or as an array (with order)

//No order
layouts = {
login = {
file = "login.cfm", views="", folders=""
}
};

// With Order
layouts = [
{name="login", file="login.cfm", views="", folders=""},
{name="admin", file="admin.cfm", views="", folders=""}
];


It is important that the array definition denotes order for lookups of views and folders.
Luis Majano
Link | Top | Bottom
cftagger
Corporal

Joined: 10/06/09
Posts: 24
RE: Problem with layout folders / CF9
03/15/10 5:46 AM

The array notification always throws an

"You have attempted to dereference a scalar variable of type class coldfusion.runtime.Array as a structure with members. "

error... ?
Link | Top | Bottom

Galleon Forums V1.7.008 was created by Raymond Camden