http://coldfusion.com logo
Join Slack
Powered by
# fw1
  • f

    fmdano

    03/06/2022, 8:57 PM
    Hey all, another FW/1 question...when I am trying to bring up my site, I get a subsystem is undefined in Request....I figure I am missing some setting in my application.cfc file...what is missing is it something in the variables.framework struct, or something else....thanks
    m
    t
    • 3
    • 13
  • d

    DWilson

    03/19/2022, 11:00 AM
    Hello all. I have a FW/1 website with subsystem for salespeople. It has various sections such as sales, contacts, earnings, etc. All sections of the salesperson subsystem share a common layout that displays the salesperson header (salesperson's name, location, title and links to sections they can access). In order to display the subsection layout, I have to perform some logic in order to determine what sections the current user can access and then save rc variables used by the layout to display the salesperson header. My question is, where do I put the code for that logic? My first thought would be to put the code in the controller. But there's no 'default controller' for all sections of a subsystem. I would have to put the same lines of code in EACH controller for each section of the subsystem (sales, contacts, earnings, etc). That would seem to violate the D.R.Y. principle. My second thought was placing the code in the subsection's default layout since the code would only appear once, but that would seem to violate MVC rules of where logic should go. Where is the best place to put that code?
    a
    c
    • 3
    • 4
  • z

    Zac Warner

    04/12/2022, 6:36 PM
    anyone seen this error before?
    a
    • 2
    • 2
  • m

    mjclemente

    04/12/2022, 8:36 PM
    So, Wirebox has the concept of Virtual Inheritance (https://wirebox.ortusbooks.com/advanced-topics/virtual-inheritance), where you can effective blend two cfc's together - wondering if anyone has tried anything similar in an FW/1 app?
    c
    d
    • 3
    • 5
  • t

    tonyjunkes

    04/18/2022, 7:14 PM
    @sneiland, it was mentioned in another thread, https://cfml.slack.com/archives/C06TSRXCJ/p1650198894595509, that installing fw1 from commandbox is always resolving to 4.3.0 regardless of the version provided. The reason is due to the box.json location field included in each published version on ForgeBox telling it to grab from the develop branch. The solution would be to update the box.json string for each published version on ForgeBox to have location point to a tagged version in GitHub. At the moment, 4.2.0 is the latest version on ForgeBox even though it's grabbing 4.3.0. Wanted to bring this to your attention. I can raise an issue on GitHub as well if you'd like to track it. Happy to assist where I can.
    s
    • 2
    • 1
  • o

    oranuf

    05/12/2022, 5:47 PM
    Got a Service component using existing DI with no issue, but when I attempt to add another service component to it - either via a constructor argument or a property in coldspring.xml, it simply will not inject the new component. I am getting what looks like a stack overflow error of some kind. If this is a chicken/egg thing I'm not seeing it. Where should i start to look for the cause? The additions I am making to coldspring.xml and the component getting the new reference look exactly like all the other DI settings/moves that are working... seems like this should have been a straightforward addition to the component's properties, but it just won't work.
  • o

    oranuf

    05/12/2022, 5:48 PM
    in the component:
    property name="emailService" required="true" type="EmailService" ;
    in coldspring.xml:
    <bean id="appService" class="components.services.AppService" singleton="true">
    <property name="appConfig">
    <ref bean="appConfig"/>
    </property>
    <property name="appGateway">
    <ref bean="appGateway"/>
    </property>
    <property name="emailService">
    <ref bean="emailService"/>
    </property>
    </bean>
    s
    • 2
    • 4
  • f

    fyroc

    05/17/2022, 1:32 PM
    Our existing application currently is moving to a proxy that points to http://foo.com/bar/ One of the issues with this is the redirects are just going to http://foo.com/ like it was orginally. Is there a configuration I can add to fw1 that allows me to define this path?
  • w

    websolete

    05/17/2022, 1:42 PM
    look at routes in the docs. it's a key you can define in variables.framework in application.cfc
  • f

    fyroc

    05/17/2022, 1:50 PM
    I went through one.cfc and found variables.framework.baseURL right after I posted this
  • b

    bockensm

    05/26/2022, 2:40 AM
    Does anyone have any good CORS info as it relates to FW1? I'm running in to so weird issues and I think I'm setting up the preflight options and such correctly in the framework settings. It works great on my dev but when I take it to production, all hell breaks loose and I can't get JSON back from my app.
    s
    m
    • 3
    • 35
  • d

    davla

    06/07/2022, 2:53 PM
    I have just spun up a new fw/1 site using commandbox fw/1 to create a basic skeleton app. I am just playing with the configuration and was trying to setup a route to an ‘about’ page. The home controller has an ‘about’ method and I have a view in the home folder called about.cfm. I prefer to set ‘home’ as my defaultSection and index as my defaultItem. In variables.framework I have this in the routes:
    Copy code
    routes = [
    			{"/about" = "/home/about"}
    		]
    If I the
    box server start
    I get my basic index page loading. If I then go to /about I get a 404 not found error? Is there a config I am missing to activate the routes functionality?
  • d

    davla

    06/07/2022, 2:56 PM
    I note also that the
    [siteuri]/home/about
    also doesn’t work but
    ?action=home.about
    does. Do I still need to specify rewrite rules and if so do they need to handle just the route
    /about
    ?
  • d

    davla

    06/07/2022, 3:00 PM
    Looks like a rewrite issue
  • d

    davla

    06/07/2022, 3:01 PM
    Added this rule:
    Copy code
    <rule>
       <note>search engine friendly urls for cf frameworks</note>
       <from>^(.*)$</from>
       <to>/index.cfm$1</to>
    </rule>
    seems to have done the trick!
    ✅ 1
  • k

    Kannan

    06/07/2022, 3:24 PM
    Did you add omit index setting in your app.cfc file @davla
    variables.framework = {
    generateSES = true,
    SESOmitIndex = true,
    routes = [
    ]
    };
  • d

    davla

    06/07/2022, 3:25 PM
    Yes, thanks @Kannan I added both of those flags - it’s working now - I needed a rewrite rule to handle the route
    ❤️ 1
  • k

    Kannan

    06/07/2022, 3:26 PM
    https://framework-one.github.io/documentation/4.1/developing-applications/#url-routes
  • d

    davla

    06/22/2022, 6:22 PM
    I think I am trying to get too much from routes in fw/1. Can routes handle multiple parameters? For example:
    Copy code
    routes = [
        { "/{region:(north|east|midlands|london|southeast|southwest|moreregions)}/?$" = "/home/region/region/:region" }
    ]
    works as expected so
    /southeast
    routes to home/region/region/southeast and runs the home.region controller passing region=southeast. Now this route doesn’t seem to work:
    Copy code
    routes = [
        { "/{region:(north|east|midlands|london|southeast|southwest|moreregions)}/{area:([A-Za-z0-9-_]+)}/?$" = "/home/area/region/:region/area/:area" }
    ]
    This should handle
    /southeast/oxfordshire
    and route to home.area controller passing both region=southeast and area=oxfordshire If I hit the url
    /home/area/region/southeast/area/oxfordshire
    the correct page loads but
    /southeast/oxfordshire
    fails. Here’s my full routes array:
    Copy code
    routes = [
    	{ "/about/?$" = "/home/about" },
    	{ "/search/?$" = "/home/search" },
    	{ "/locations?/?$" = "/home/areas" },
    	{ "/{region:(north|east|midlands|london|southeast|southwest|moreregions)}/{area:([A-Za-z0-9-_]+)}/?$" = "/home/area/region/:region/area/:area",
    	{ "/{region:(north|east|midlands|london|southeast|southwest|moreregions)}/?$" = "/home/region/region/:region" } }
    ]
    Any ideas?
  • w

    websolete

    06/22/2022, 6:26 PM
    move the last rule above the fourth to the last (swap the last two). have it satisfy the shortest route first since you're pinning the end of the match to $
  • w

    websolete

    06/22/2022, 7:14 PM
    what's the actual url that gets that result?
  • d

    davla

    06/22/2022, 7:15 PM
    http://localsite.test:60050/southeast/oxfordshire
  • d

    davla

    06/22/2022, 7:16 PM
    http://localsite.test:60050/southeast routes perfectly to home.region with rc.region set to southeast
  • d

    davla

    06/22/2022, 7:16 PM
    It must be the double parameters that it doesn’t like - maybe a bug in fw/1?
    s
    • 2
    • 1
  • w

    websolete

    06/22/2022, 7:19 PM
    i would try with numeric backreferences, i honestly haven't done routes like you have above. something like
    Copy code
    { "/(north|east|midlands|london|southeast|southwest|moreregions)+/?$" = "/home/region/region/\1" },
    		{ "/(north|east|midlands|london|southeast|southwest|moreregions)+/([A-Za-z0-9-_])+/?$" = "/home/area/region/\1/area/\2" }
  • d

    davla

    06/22/2022, 7:19 PM
    I normally just use apache rewrite rules to handle these but thought for this new project I would try using routes - may have to go back to the apache rewrite option which is annoying as I have to create tuckey rewrites for local commandbox AND apache rewrites for each url pattern.
  • d

    davla

    06/22/2022, 7:19 PM
    I’ll give that a try.
  • d

    davla

    06/22/2022, 7:22 PM
    Bingo! Thanks @websolete that fixed it - I’ll switch to the backreferences way - I had picked up the
    {region:(...)}
    from the fw/1 docs.
  • w

    websolete

    06/22/2022, 7:23 PM
    yeah, never used them. seems like a good idea, but i've never personally tried it
    👍 1
  • d

    davla

    06/28/2022, 8:46 PM
    I have just deployed my fw/1 site up onto aws (newly built ec2 instances) and must have missed a step somewhere as I am getting the following error:
    Copy code
    Problem with metadata for jobs (<http://var.www.sites.sjbeta.model.services.jobs|var.www.sites.sjbeta.model.services.jobs>) because: Unable to getComponentMetadata(<http://var.www.sites.sjbeta.model.services.jobs|var.www.sites.sjbeta.model.services.jobs>) because: invalid component definition, can't find component [<http://var.www.sites.sjbeta.model.services.jobs|var.www.sites.sjbeta.model.services.jobs>], near line 458 in /var/www/sites/frameworks/framework/ioc.cfc
    I have a mapping for /framework pointing to ‘/var/www/sites/frameworks/framework’ set in Lucee admin. I also have an Application mapping:
    Copy code
    this.mappings = {
    				 "/": "/var/www/sites/sjbeta/"
    };
    I have the site running on my local machine using commandbox. What have I missed?
12Latest