http://coldfusion.com logo
Join Slack
Powered by
# cfml-general
  • j

    Jeff Stevens

    08/26/2022, 2:02 PM
    Hello! I have a question about mixing ColdFusion and Javascript. I have code that is structured in the following way:
    Copy code
    <cfoutput>
    ...
         <cfloop>
              <cfset FormElementPK = rc.formElements.getRow(i)["FormElementsPK"]>
              <script>
                   //Create a listener for the question text editor to check for errors on blur
                   var #toScript(FormElementPK, "jsFormElementPK")#;
                   var inputFieldId = document.getElementById("##question" + jsFormElementPK + "TextEditor");
                   $(inputFieldId).on('blur', function(e) {
                                    alert("I am a test message!");
                                    checkQuestionTextForErrors(inputFieldId);
                                });         
              </script>
              ...
         </cfloop>
    ...
    </cfoutput>
    Its intended effect is to dynamically generate Ids and then create Jquery event listeners for those Ids. The problem I have is that the event listeners work only when I hardcode the Ids (replace inputFieldId with "##question1TextEditor" etc). I'm wondering, why does this not create working event listeners when I dynamically generate the Ids the way code above does?
    w
    j
    +2
    • 5
    • 16
  • m

    Mark Berning

    08/26/2022, 2:52 PM
    Anybody have a good examples of using the parallel features or multi-threading <cfhttp> requests? We are doing a ton of AWS REST API calls across AWS regions. 1. We loop in serial the regions (usually 4 regions) 2. Then process the results 3. Then usually build a query/structure of the combined region results. If I could call each region AWS API in parallel then combine the results that would give me 3x-4x speed improvement.
    s
    f
    b
    • 4
    • 6
  • b

    Brian

    08/29/2022, 12:29 PM
    I do get concerned when I see things like this and CFML isn't even listed. https://spectrum.ieee.org/top-programming-languages-2022
    d
    a
    +6
    • 9
    • 15
  • r

    Rodney

    08/29/2022, 12:55 PM
    Please use threads. It's best to post your question first and then add code and follow up text in the thread. Thanks.
  • c

    C. Jason Wilson

    08/29/2022, 12:56 PM
    My apologies
  • c

    C. Jason Wilson

    08/29/2022, 12:57 PM
    I'm tasked with creating a log of active memory usage. I'm struggeling with terminating threds. I can't seem to get the terminate() function in my CFC to stop the thredded filewrite. Is this even possible? I'm leaning towards not possbile for this task. What are your thoughts/suggestions?
    s
    b
    a
    • 4
    • 14
  • b

    Brian

    08/30/2022, 2:41 PM
    I'm really enjoying @chris-schmitz's presentation from the Hawaii ColdFusion User Group meeting and am working along with it. The one thing I've run into is that my methods aren't displaying like his are. I thought maybe this was a debugging setting, but I haven't found anything in that part of the CF admin or anywhere else in the CF admin to change it. Does anyone know why the methods won't display?
    c
    p
    +2
    • 5
    • 13
  • o

    Ookma-Kyi

    08/30/2022, 10:25 PM
    After a user resets their password, what is the general process as far as tokens and token expiration goes security-wise? Do I set token to empty and the token expiration to now() , set null to empty, etc.?
  • e

    elpete

    08/30/2022, 10:52 PM
    We like to set the tokens in a cache with an expiration of 10 to 15 minutes. Then there’s nothing for us to cleanup later.
  • o

    Ookma-Kyi

    08/31/2022, 3:07 PM
    What do you mean by in a cache?
    b
    • 2
    • 43
  • f

    Formiko

    08/31/2022, 3:36 PM
    Who still uses cf 11 in production? And if so, how is the s3 support?
    m
    e
    +2
    • 5
    • 12
  • f

    Formiko

    08/31/2022, 7:08 PM
    The job I'm at settled with OneDrive for file storage. Does anyone know if onedrive plays nice with coldfusion before I read the docs? My apps needs to access and display xlsx files. Can I simply use cffile and cfspreadsheet?
    p
    • 2
    • 3
  • d

    drewnathanson

    08/31/2022, 7:16 PM
    Well, I have had this issue before. I found that in order to get this work correctly (assuming this is Windows), you will need to create an account on the OneDrive with total read/write access. Once you get that done, you will need to change the CF process (as to who is logged in as) to that account. This can found in the Services process. You will also need to change the permissions on the directory to the new account. This is really important. Restart the process. Once this is one, you should be able to either get to one drive either by mapping the drive or using the UNC to do it.
  • f

    Formiko

    08/31/2022, 8:21 PM
    Thanks...but I don't have administrator access..itll have to be (l)user access, will this be possivble?
    d
    • 2
    • 1
  • i

    iknowkungfoo

    08/31/2022, 9:17 PM
    Anyone know who's running http://learncfinaweek.com/? It's not responding for me. I've checked from a couple of systems.
  • i

    iknowkungfoo

    08/31/2022, 9:20 PM
    @dfgrumpy Would that be you?
    c
    f
    +4
    • 7
    • 12
  • a

    Adam Cameron

    09/01/2022, 8:06 PM

    https://i2.paste.pics/37fefdcfa6c1b7430620331c431c0db9.png▾

    Ben Forta just turned in his grave.
    m
    w
    +5
    • 8
    • 12
  • j

    Jason Ryan

    09/02/2022, 6:18 PM
    Anybody know if there's a way and/or how to remove
    com.fasterxml.jackson.core:jackson-databind
    from the Lucee docker images? I tried out the light build, which unlike the normal build appears to not include this in
    /opt/lucee/server/lucee-server/bundle
    but my ECR image scan is still flagging numerous critical vulnerabilites coming from that package (like 30+) Edit: Was able to determine this comes from Commandbox (
    root/.CommandBox/engine/cfml/cli/lucee-server/bundles/org.lucee.ehcache-2.10.3.jar
    )
    b
    s
    • 3
    • 11
  • a

    Adam Cameron

    09/04/2022, 2:04 PM
    Some CFML shiz: https://blog.adamcameron.me/2022/09/cfml-invokeimplicitaccessor-on-cfcs.html
  • w

    websolete

    09/04/2022, 5:22 PM
    i always thought invokeImplicitAccessors was a stupid idea from the get go. you've got the THIS scope if you need external exposure, and you have multiple options for referencing variables-scoped/property values within the cfc depending on how terse you want to be with your code. all this accomplishes is to make cfc variable scoping even more confusing and unintuitive for the masses, particularly new cf devs (as if there were any)
    a
    g
    +2
    • 5
    • 56
  • w

    websolete

    09/04/2022, 5:24 PM
    also, i've never seen this done: `
    Copy code
    property string variables.firstName;
    with variables. explicitly included. is that a typo or is there some benefit to doing that, given that properties will be in the variables scope anyway...
    a
    g
    • 3
    • 3
  • g

    Gareth

    09/05/2022, 3:24 AM
    has anyone ever considered creating a tree-sitter for CF ? https://tree-sitter.github.io/tree-sitter/
    d
    • 2
    • 3
  • d

    dfgrumpy

    09/05/2022, 4:16 AM
    FYI.. learncfinaweek site is messed up and will probably need to be moved to a new host. So, if anyone wants to donate some hosting that would be great.
    m
    a
    +3
    • 6
    • 32
  • p

    Pete Williamson

    09/05/2022, 12:57 PM
    Running a Linux CentOS server, it's one purpose in life is to serve CF11, which it generally does very well. But last week "Java" was killed by the oom-killer, and the process that triggered it was "C2 CompilerThre":
    Copy code
    C2 CompilerThre invoked oom-killer: gfp_mask=0x280da, order=0, oom_score_adj=0
    This shows Java being killed in the logs:
    Copy code
    Out of memory: Kill process 73217 (java) score 733 or sacrifice child
    Killed process 73217 (java), UID 48, total-vm:12282868kB, anon-rss:6391832kB, file-rss:0kB, shmem-rss:0kB
    Can anyone shed any light on how the C2 Compiler is related to excuting CFML code, and if there's anyway I can work out exactly what it was up to?
    g
    • 2
    • 2
  • g

    gsr

    09/05/2022, 2:38 PM
    i want to pass the following to the cfc but i am getting an error
    Copy code
    FIELDNAMES TABLESLISTS[]
    TABLESLISTS[] dbo.projects
    old code is passing the value from ajax by declaring a array object and then push it to the call as {TABLESLISTS : TABLESLISTS} i wonder how to fix it
    a
    a
    • 3
    • 12
  • d

    Dave Merrill

    09/05/2022, 2:46 PM
    This morning a common configuration cfm file got replaced by the html of a cfdump of an error, on the production server> Needless to say, that didn't work very well. Once I figured out what had happened, I just reverted the file in source control, and the site was functional again. That file is manually written by developers, code should never be writing to it, and the only mentions of it in code cfinclude it, that's all. Has anyone seen anything like that happen? Thoughts?
  • g

    gsr

    09/05/2022, 6:33 PM
    i am using cf2021, and i am trying to load datasources using following method
    Copy code
    <cfset objDS = createobject("java","coldfusion.server.ServiceFactory").getDatasourceService().getDatasources() />
    <cfdump var="#objDS#" abort>
    <cfoutput>
    <table border="1" cellpadding="3" cellspacing="0" width="50%">
    <tr>
    <th><b>DataSource</b></th>
    <th><b>Username</b></th>
    <th><b>Password</b></th>
    </tr>
    <cfloop collection="#objDS#" item="Key">
    <cfif len(objDS[Key]["password"])>
    <cfset password = Decrypt(objDS[Key]["password"],generate3DesKey("0yJ!@1$r8p0L@r1$6yJ!@1rj"), "DESede","Base64") />
    <tr>
    <td>#objDS[key].name#</td>
    <td>#objDS[key].username#</td>
    <td>#password#</td>
    </tr>
    </cfif>
    </cfloop>
    </table>
    </cfoutput>
  • g

    gsr

    09/05/2022, 6:34 PM
    i am getting an error on getDatasources() when i try to use it, CF does not get it, even though it is defined in the class of
    getDatasourceService()
    s
    • 2
    • 3
  • g

    gavinbaumanis

    09/06/2022, 5:18 AM
    Hi - How do I throw an exception? In that I want to to write;
    if( myVar = 2) {
    throw("myVar = 2. It should never be 2");
    }
    But it fails - because it isn't in a try/catch. Only - I don't want to catch it. I want it to blow up the request.
    b
    • 2
    • 5
  • w

    websolete

    09/06/2022, 2:13 PM
    is there some equivalent way to use safe navigation when using square bracket struct notation?
    Copy code
    var env = server?.system?.environment ?: {};
    if( env.keyExists(arguments.name) ) { ... }
    
    to this: 
    
    var env = server?.system?.environment?[arguments.name] ?: "";
    or something similar. it's not hugely important to do the second way, just curious if there's a square bracket version of safe navigation
    t
    d
    a
    • 4
    • 14
1...161718...38Latest