http://coldfusion.com logo
Join Slack
Powered by
# cfwheels
  • p

    Peter Amiri

    02/01/2022, 1:47 PM
    @neokoenig I like what you've got started in the move-wheels branch. I will see if I can achieve what I want with just repackaging the current structure. I'm thinking of creating a wheels-core package that is just the wheels folder and a wheels-template-advanced that is all the other folders with a dependency on wheels-core that pulls in the wheels folder. This would allow sharing of wheels apps without including the wheels folder. Then I plan on creating a bunch of templates like wheels-template-helloworld, wheels-template-hellodynamic, and wheels-template-hellodatabase. Then the last step of the CLI wheels new would become specifying the template to use instead of hard coding the Bootstrap 3 templating into the Wheels CLI. It's not the full separation of concerns that V3 would bring but it starts that process.
    n
    r
    • 3
    • 5
  • p

    Peter Amiri

    02/03/2022, 3:49 PM
    @neokoenig While trying to build up my templates I may have discovered a bug in the URLFor() function that was introduced with https://github.com/cfwheels/cfwheels/commit/b5521d68ddf1ba46bcccd8241060df05a8c7e370#diff-53fb5848da39e7b3637d1ba65[…]dc9cefb64baf007c3528dad1f9c956 This break simple wildcard routes. This may have been why some people were getting frustrated going through the simple tutorials and having the multipage linking not working. To test my premise, open up CommandBox, create a directory, and download my Hello Pages template:
    Copy code
    box
    mkdir testURLFor --cd
    install cfwheels-template-hellopages
    Now start your server. You'll see a page one that has some links to page two which has some links to page three and then back to one. There are three sets of links on each page, the first uses a named route, the second specifies just an action, and the third specifies the controller and action. You'll see this links work fine and you can navigate to the next page using any of the links. Now go to your address bar and specifically go to
    /index.cfm/wildcard/one
    you'll see a similar page with links to get you to the next page. I turn the first link into a static text cause we don't have named routes for the wildcard controller. Now you see the wildcard links are broken. They only contain the controller name. It's not the routing engine cause you can go to the address bar and enter
    /index/wildcard/two
    and
    /index.cfm/wildcard/three
    and the proper page comes up but the link that are built by the LinkFor() function are broken. Now go into
    /wheels/global/misc.cfm
    and comment out the else if block on line 669-672. Now reload your app and visit
    /index.cfm/wildcard/one
    and you'll see the wildcard links built by specifying only the action or the controller and action now work.
    n
    d
    • 3
    • 12
  • p

    Peter Amiri

    02/04/2022, 10:04 PM
    @neokoenig I just posted another PR for the CLI. This one has a new
    wheels create app
    command and modified the
    wheels NEW
    command to remove the bootstrap options. I've also got three templates posted to ForgeBox and worked with Brad Wood to create a new CFWheels Templates type/grouping in the listing.
    👍 2
    n
    • 2
    • 3
  • p

    Peter Amiri

    02/07/2022, 7:50 PM
    @neokoenig I've put a new PR out there. This one refactors the app creation scripts and should be ready for prime time.
    Copy code
    wheels generate app
    wheels generate app-wizard
    The app-wizard runs the user through menus and passes the parameters gathered to the app command. These commands can obviously be shortened to:
    Copy code
    wheels g app
    wheels g app-wizard
    The app-wizard command also has an additional alias:
    Copy code
    wheels new
    n
    • 2
    • 2
  • p

    Peter Amiri

    02/11/2022, 2:45 PM
    @neokoenig I'm starting to work on turning cfwheels-example-app into a template. I could approach it two way, one is to build a template package that pulls in the existing repository another is to turn the existing repository into a template package. I think we should take the second route so this repository will serve as an example of to others on how to package an app. The ramifications of this route is that some of the directories that are framework specific or not app specific will be removed from the repository. i.e. wheels folder and miscellaneous folder.
    n
    • 2
    • 2
  • p

    Peter Amiri

    02/12/2022, 5:00 AM
    @neokoenig I just submitted a PR on the cfwheels repository for a primary key detection issue in the H2 driver. CFDBInfo does not properly set the isPrimaryKey flag in the column info call. I updated the H2 driver to detect the primary key from the index info.
    👍 1
    n
    • 2
    • 2
  • p

    Peter Amiri

    02/17/2022, 8:56 PM
    @neokoenig can you do a test for me? I'm getting random java.lang.NullPointerException errors after installing the example app. Not sure if it is specific to my machine before I start digging into it I wanted a second set of eyes. To install the app run:
    Copy code
    wheels g app template=cfwheels-template-example-app --setupH2 name=exampleApp datasourceName=exampleApp directory=exampleapp
    Then start the server:
    Copy code
    start
    Once the server starts up, you'll have to install the H2 extension:
    Copy code
    install
    Then after a minute, you can run the migrations:
    Copy code
    wheels dbmigrate latest
    I've also put in an installation check page so the users don't get CF Engine errors during the process.
    n
    • 2
    • 6
  • p

    Peter Amiri

    02/17/2022, 9:12 PM
    I ran it on a Windows VM just before I saw your message and noticed the issue, so I was in the process of sending you the updates.
    n
    r
    • 3
    • 14
  • a

    Adam Cameron

    03/04/2022, 8:52 AM
    Question on the
    validate
    method (https://api.cfwheels.org/v1.4.5#validate)... this allows one to set validation handlers to be called when validations happen. Do they occur before, after, or instead of CFWheels' built-in-based-on-the-DB-schema validations? I don't see comment one way or the other on https://guides.cfwheels.org/docs/object-validation. Context: I have a property that is backed by a nullable date in the DB. By the time one of my bespoke validation handlers is called, will the inbuilt validation already have pushed back if the passed value is
    "slartibartfast"
    (or some other non-date value), or does my handler still need to guard against it being a date? I am presuming validation fails could be a cumulative thing, so I do need to guard against it. In this case I at least have to do a null-check before I do anytime timeframe validations on the value, I guess.
    n
    • 2
    • 2
  • a

    Adam Cameron

    03/04/2022, 11:07 AM
    I am clearly blind. Where is the text for the validation failure messages, eg: I pass a non-date to a date property. I'm looking for a string like "must be a date" or even any string that looks like it might be part of a validation failure message.
    n
    • 2
    • 11
  • j

    jumpmaster

    03/09/2022, 1:43 PM
    Does anyone have experience dealing with webhooks in cfwheels? Any post requests from an external server fails the csrf checks because there is no authenticity token, so my workaround was to create an additional isWebhook function to verify the signature. This is working for now, but it feels weird modifying the backend wheels code. Is there a better way to do this?
    n
    • 2
    • 2
  • a

    Adam Cameron

    03/15/2022, 12:36 PM
    @neokoenig I think you have a race condition situation here (https://github.com/cfwheels/cfwheels/blob/master/wheels/global/internal.cfm#L784-L785):
    Copy code
    public void function $addToCache(
        // ...
    ) {
        // ...
    		for (local.key in application.wheels.cache[arguments.category]) {
    			if (Now() > application.wheels.cache[arguments.category][local.key].expiresAt) {
    Seems to me like there's no guarantee that
    application.wheels.cache[arguments.category][local.key]
    will still be there when you come to assume that it does.
    • 1
    • 3
  • a

    Adam Cameron

    03/20/2022, 1:29 PM
    Just an FYI. I've just done a fresh CFWheels install from forgebox, and on the "You have successfully installedversion 2.2.0 of CFWheels." (sic: not the missing space in there, btw) page that loads on the
    /
    route by default there is a link "View and code along with our "Hello World" tutorial.". This goes to https://guides.cfwheels.org/v2.2/docs/beginner-tutorial-hello-world, which 404s.
    • 1
    • 1
  • a

    Adam Cameron

    03/20/2022, 2:08 PM
    A coupla days ago, @Mr M raised a situation they were having with the beginners tutorial (see https://cfml.slack.com/archives/C1QB85ZJ5/p1647699598608829). Because I had a surplus of will-to-live today, I thought I'd try an exercise in CFWheels, which necessitated me building a new CFWheels site, so I figured the best thing to do would be to follow the same tutorial. I got to the same point as Mr M, and encountered the same problem. And to me, having looked through the code to where it's going wrong, it looks like a bug. Details in thread...
    p
    • 2
    • 26
  • a

    Adam Cameron

    03/21/2022, 8:57 AM
    I see:

    https://i2.paste.pics/ec0a9486a50268b595d2dbf303bb3cf9.png▾

    Is anyone else from the CFWheels project here? If Tom's not here any more, I question the merits of the channel existing..? https://groups.google.com/g/cfwheels is probably a better way to go..?
    p
    • 2
    • 2
  • d

    djuggler

    03/22/2022, 9:44 PM
    buttonTag() got it.
    a
    p
    • 3
    • 8
  • a

    Adam Cameron

    03/24/2022, 5:31 PM
    I wonder if I could get some clarification on the usage of
    $
    as a prefix to method names in CFWheels. It seems to me that this is used in lieu of actually making a method private. The only reference I have been able to find for this in the docs is a mention in passing:
    If you have functions that should only be called from the plugin itself, we recommend starting the function name with the
    $
    character (this is how many internal Wheels functions are named as well)
    (my emphasis, and that is from https://guides.cfwheels.org/docs/developing-plugins#using-a-plugin-to-add-or-alter-capabilities) I could find no other explicit explanation, but
    $
    is hard to google for, so this means nothing. I didn't find anything further searching for "private" or "internal" either, that said. I want code to run every time a model object is created. Normally I would put this in the constructor of the class, but for reasons that I cannot fathom, CFWheels does not call
    init
    when it creates an object. So that's no good. I have found
    $createInstance
    in
    wheels.Model
    , and if I override that in my own models, it seems to work as I'd expect. Certainly when I call
    new
    /
    findOne
    /
    findAll
    on the model factory object, it seems to be called on the returned model object(s). However I am cautious that it's a method prefixed with
    $
    , therefore "internal" to CFWheels. I should probably not be messing with it, or calling it directly (even in an overridden implementation of itself). So is there a more CFWheels-idiomatic way of doing this? Or am I fine with this approach? Cheers.
    p
    • 2
    • 3
  • a

    Adam Cameron

    03/25/2022, 12:06 AM
    Do you think a good blog topic might be something addressing the situation that most of the "core team" of CFWheels retired, in the last few days?
    d
    t
    p
    • 4
    • 4
  • r

    risto

    03/31/2022, 9:16 PM
    delete button hell - so in my app on edit pages I have a update button to left and delete to the right. ButtonTo() in the same form as regular submit will just submit the edit form and you get an error about method delete not accepted. linkTo() doesn't work with delete method. Has anyone done what I'm trying to do? I'm trying to do this on a site without jquery. I mention this because all apps in the past I have an old rails javascript that allows me to submit a delete link as DELETE method. So I do have a fallback but wondering what people are doing lately.
    a
    p
    • 3
    • 20
  • p

    Peter Amiri

    04/10/2022, 9:07 AM
    https://www.bennadel.com/blog/3678-using-function-localmode-modern-to-more-safely-render-coldfusion-templates-in-lucee-5-3-2-77.htm
    ⭐ 1
    a
    • 2
    • 1
  • p

    Peter Amiri

    05/10/2022, 3:16 PM
    Thanks @risto. I'm really hoping for a flood of guide based PRs. Hint, Hint... 😉
    r
    • 2
    • 1
  • p

    Peter Amiri

    05/16/2022, 11:42 PM
    CFWheels launches a Bug Bounty program. Read the full blog post here: https://cfwheels.org/blog/cfwheels-announces-a-bug-bounty/
  • p

    Peter Amiri

    05/17/2022, 5:37 PM
    In case you missed it, CFWheels was selected as the ForgeBox Module of the Week a few weeks ago. https://cfcasts.com/series/2022-forgebox-modules-of-the-week/videos/cfwheels-core-and-base-forgebox-module-of-the-week-2822-episode-134
    ⭐ 3
    👏 2
  • m

    mike42780

    05/25/2022, 3:51 PM
    I'm interested in how people handle post form save emails in CFWheels. For example, someone submits a form with a user comment field. That comment gets emailed to someone for review. Do you handle the email in the controller such as this: if (comment.save()){ emailNewComment(); } Or do you handle it inside the model with something like afterSave("emailNewComment"); I've done both. I'm assuming since this isn't directly dealing with a database the answer is to do it in the controller? However it's sometimes convenient and nice to handle it in the model. Keeps the controller a little cleaner and I get to see what happens after a save directly in the model. However, inside the model there isn't access to the includePartial() function if I want to put the body of the email in a separate file. Or any other functions inside the controller easily. Just wondering any other pros/cons and if there's a recommended way. Thanks.
    a
    p
    s
    • 4
    • 21
  • d

    David Belanger

    05/25/2022, 8:44 PM
    Hey @mike42780, not to get mixed up in that very opiniated thread about MVC perfection, I too have done both in several projects. When it comes down to sending out an email, I see that as a View (just like when I return PDFs or Excel) that gets called from the Controller. Naturally, the email never gets returned directly to the user but you can fire it off just the same from the Controller and still return them to a success screen. Personally, I like the Active Record model approach to things because it keeps things simple and centered around the data. Because of that, I usually only use afterSave if it affects another model. But that's just me, that doesn't mean you need to do it that way.
    a
    m
    • 3
    • 5
  • a

    Andreas

    06/05/2022, 10:40 PM
    Sorry for the maybe stupid question... I may be blind... But... where can I find the repository of the live site cfwheels.org? The very first button in the top hero at cfwheels.org section "get started" is linked to a 404. Where should I post that issue to?
  • p

    Peter Amiri

    06/06/2022, 12:04 PM
    @Andreas, thanks for catching that. To answer your question, you can post it at https://github.com/cfwheels/cfwheels/discussions. That button has been corrected by the way.
    👍 2
  • b

    Brian Lang

    07/07/2022, 10:15 PM
    I want to MANUALLY download a CFWheels Plugin - specifically https://www.forgebox.io/view/cfwheels-js-confirm I can't find a link on that page to manually download the plugin. Where can I get it?
  • p

    Peter Amiri

    07/07/2022, 10:21 PM
    If you have commandbox installed, you can just do ‘box install <plugin-name> in any directory and you'll get the zip file.
  • p

    Peter Amiri

    07/07/2022, 10:24 PM
    For that particular plugin you can click on the home icon in the right hand pane, that will take you to the GitHub repo and on the right hand side of the repo is the releases.
12Latest