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

    Dean Lawrence

    02/09/2022, 1:51 PM
    I’m having a random error where cfquery is not using the global datasource name defined in my Application.cfc file. I have a datasource defined using this.datasource, but occasionally (fairly frequently lately), ACF throws a “The value of the attribute datasource, which is currently ‘’, is invalid.” error for random cfquery tags that have no datasource attribute and only the name attribute defined. <cfquery name=“myQuery”> Any ideas as to what might be causing this and how to fix it? Also, this is a site that has been running for over a decade on CF and primarily uses Hibernate and ORM. CF version 2018,0,13,329786
    r
    a
    a
    • 4
    • 21
  • r

    ryan

    02/09/2022, 2:43 PM
    Question regarding
    cfloop
    : Reading the documentation in Adobe about
    index
    and
    item
    attributes for a list is quite vague as to how these attributes work together. When only using
    index
    attribute (ie
    index="idx"
    ), the list element is assigned to the
    idx
    variable within the loop. However, when using both
    index
    and
    item
    attributes (ie
    index="idx" item="itm"
    ), the behavior of the
    index
    attribute changes by assigning the true index number of the item in the list and the
    item
    attribute is assigned the element, instead. Why does the behavior for the
    index
    attribute have to change? Is it because of backward compatibility? If a developer wants to only grab the true index number in a list, then they are forced to extraneously include the
    item
    attribute. Am I missing something?
    r
    w
    +2
    • 5
    • 25
  • a

    aliaspooryorik

    02/09/2022, 3:47 PM
    Just discovered this https://jsonapi.org/format/#document-top-level - anyone used it and have opinions?
    r
    d
    +3
    • 6
    • 40
  • l

    Lukas

    02/10/2022, 10:12 AM
    this is probably a bit off-topic, but I need to decrypt a string in Python which was encrypted in cfml via
    Copy code
    encrypt(arguments.clearText, local.AES_Key, 'AES', 'HEX')
    does anyone have any clue on how to achieve this?
    m
    • 2
    • 1
  • n

    nickg

    02/10/2022, 4:27 PM
    Hi All. Kind of a strange issue here. We're using the "encodeForHTML" function in ACF 2016 and finding that with upper case international characters (like "A" with an accent), it seems to change them to lower case (while keeping the accent). Everything else seems fine but we can't figure out why it is changing the special characters to lower case. Anyone else run across this?
    t
    d
    +2
    • 5
    • 49
  • k

    kyle

    02/10/2022, 9:07 PM
    Sorry for the crosspost, but I got no responses on #cflint: hey all, I’ve used CFLint before, but not in the last couple of years. I’m trying to get it working to scan a FW/1 app, but I’m not even able to get it to report any issues when running against a single file (that should have issues with variable names, scoping, and other stuff). I initially tried running cflint in vscode (which wasn’t working). Since then I’ve tried running cflint directly [on a mac: java -jar ~/Projects/cflint/CFLint-1.5.0-all.jar -file controllers/linttest.cfc], and I’ve tried installing it with commandbox [box install commandbox-cflint] and then running it [box cflint controllers/linttest.cfc] with no success. I’m adding my linttest.cfc for reference.  Any ideas on what I’m missing would be greatly appreciated!
    a
    • 2
    • 3
  • j

    Jason Ryan

    02/10/2022, 9:21 PM
    Is there any way to programmatically ignore the
    Application.cfc
    onError
    function? I have an
    isProduction()
    function and was hoping I could only enable the error-trapping and re-routing functionality conditionally based on that. It doesn't quite seem to work that way when NOT in prod. It just swallows up errors and doesn't display anything on the page, unless the function is commented out.
    t
    m
    +2
    • 5
    • 13
  • g

    gus_dancy

    02/10/2022, 11:09 PM
    When using <cfdocument format="PDF" how do you make pagebreaks gracefully when outputting data in a pdf?
    m
    d
    d
    • 4
    • 13
  • s

    Slackbot

    02/11/2022, 9:37 PM
    This message was deleted.
    a
    m
    • 3
    • 6
  • s

    Simone

    02/11/2022, 10:13 PM
    coldfusion2021 is not starting in commandbox, every time i pass the name, it just loads lucee
    d
    • 2
    • 2
  • s

    Simone

    02/14/2022, 4:51 PM
    how can i get the tablename when i have a query output from cfquery for each columns, i can do "tbl.column1", but i don't want to use that, is there any internal java function where i can get the tablename of the column i searched google but could not find something relevant for MYSQL, i tried cfdbinfo, but it needs table but nothing for a query where i have some joins to different tables? any clues experts
    m
    t
    +4
    • 7
    • 30
  • s

    Simone

    02/15/2022, 1:51 AM
    Welcome back Datatables Now has anyone done the Pagination using mysql limit and offset, i am doing but my results are always empty here is my gist what is wrong here, any clues https://trycf.com/gist/9fa88c22da3d85270d6e5d2758adb66d/lucee5?theme=monokai
    m
    c
    • 3
    • 25
  • m

    Manta

    02/15/2022, 1:09 PM
    is the coldfusion website down?
    b
    a
    • 3
    • 7
  • a

    Adam Cameron

    02/15/2022, 2:33 PM
    Just found myself needing to write some tag-based code and had to look up how
    <cfloop>
    worked. HA
    r
    w
    +2
    • 5
    • 15
  • j

    James Vince

    02/15/2022, 5:26 PM
    I'm trying to make an API request that sends a PDF file from my lucee web app, and I'm struggling to get it to work properly. I have it working in postman, but keep getting the error "File is not valid or path doesn't exist!" when I try to do it from my app. Can anyone tell me what I'm doing wrong? (posting picture/code in thread)
    s
    d
    d
    • 4
    • 19
  • c

    Cavan Vannice

    02/15/2022, 8:24 PM
    I'm having trouble passing a NULL value in structAppend. This is what I'm submitting
    structAppend(key,{"field": null});
    and it gives me
    Variable NULL is undefined.
    I am trying to get
    "field": null
    I tried enabling NULL at the application level, it didn't work. Any help would be appreciated, thanks.
    d
    m
    • 3
    • 14
  • a

    Adam Cameron

    02/16/2022, 11:03 AM
    I need an exception object to test some code that handles exceptions (not in the try/catch sense of handling, we just need to do some processing on an exception). I can't - for the life of me - think of a way in CFML to create an exception other than throwing one (like with
    throw
    ). And to get the object I need to then catch it. In other languages I'd do some variation of
    myException = new MyException()
    Am I being dense, or is there no such functionality in CFML? I realise I can go
    myJavaException = createObject("java", "MyJavaException").init()
    , but the testing I need to do is specific to CFML exceptions.
    t
    r
    +4
    • 7
    • 16
  • g

    glook

    02/16/2022, 4:11 PM
    page1.cfm consists of setting cfcookie named inet with a value of "fred" dumping #cookie# and there displays the cookie properly. page2.cfm consists of dumping #cookie# and seeing inet but the value is [empty string]. Aint that weird?
    d
    • 2
    • 1
  • s

    Simone

    02/16/2022, 4:53 PM
    Copy code
    how can i use cf_mycustom name="whatever" in cfscript, don't see any example
    c
    r
    a
    • 4
    • 7
  • g

    gus_dancy

    02/16/2022, 11:33 PM
    Anyone have experience putting pdf documents in an xlsx file? I can produce the pdf which is some data output in tables singularly fine using cfdocument. But when I stick them in an xlsx by doing <cfheader name="Content-Disposition" value="attachment;filename=#download_file_name#.xls"> they lose their formatting. I get this:
    g
    d
    p
    • 4
    • 4
  • b

    Ben Reid

    02/17/2022, 6:48 AM
    Anyone know if it is a configurable setting in Chrome to still show the response data in Dev Tools when a a request has a status-code of something other than 200. i.e. Firefox still shows the response, and I am certain that Chrome used to, but Chrome currently shows no response data with a status-code of say 400. We use this approach to highlight in Dev Tools the requests that had an issue, but we are used to being able to click on the request and view the response detail to see more information about the encountered issue, and also have the application react in an applicable way too.
    c
    • 2
    • 1
  • m

    mauzer

    02/17/2022, 1:21 PM
    Hi Guys - I know this is not exactly CF but I'm trying to change the css of a select box on error to red and the message but whatever Im trying its not having any effect - It is a CF project btw - just using jquery to validate 🙂 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.7.0/jquery.validate.js"></script> <form id="demographicsform" action="?action=mergeDashboardDemograpphics" method="post"> <div class="row-liquid"> <p class="span4"> <label for="corpID">Select Client</label> <select name="corpID" id="corpID" class="required"> <option value="">None</option> <cfloop query="getCorps"> <option value="#getCorps.id#"> #getCorps.label# (#getCorps.id#)</option> </cfloop> </select> </p> </div> <input type="submit" /> </form> <script> $("##demographicsform").validate({ messages: { corpID: { required: "Please select an option from the list!", }, } }); </script>
    a
    • 2
    • 11
  • g

    Gareth

    02/18/2022, 4:52 AM
    curious, is anyone doing CFML code reviews with a platform other than the typical github / gitlab ?
    r
    d
    w
    • 4
    • 4
  • w

    websolete

    02/18/2022, 9:29 PM
    what's a cfc
    a
    m
    d
    • 4
    • 31
  • s

    Simone

    02/18/2022, 9:42 PM
    can i encypt in CF and decrypt in JS
    a
    m
    +5
    • 8
    • 55
  • d

    Daniel Mejia

    02/19/2022, 12:05 AM
    Are there any gotchas with using a
    transaction { query1... query2... }
    without a
    transaction action='commit';
    ? I just learned that the commit action is not needed, but curious as to what impact there is without it.
    a
    • 2
    • 3
  • z

    zackster

    02/19/2022, 10:42 AM
    ummm, https://docs.lucee.org/reference/functions/structvaluearray.html ?
    👍🏾 1
    r
    d
    • 3
    • 20
  • s

    simiane

    02/21/2022, 1:23 PM
    Hi all, Has anyone had any experience with odata? I have a javascript library that expects to hit an odata source. It generates a funky 'filter' JSON string to represent a SQL
    where
    clause, and I need to parse this to pull data out of my DB. I was hoping this was a fairly common usecase and there'd be a library out there that can at least parse the JSON into a reasonably usable SQL string, but the only thing I can find that even references odata is Abram Adams' dao/norm project, and that seems more concerned with consuming an odata source than presenting one.
    • 1
    • 1
  • s

    Simone

    02/21/2022, 3:02 PM
    i am converting Application.cfm to a CFC , there is a custom function in Application outside of any inbuild Application.cfc methods, i have like ParaFormat2 and in the whole Application, it is not referred to any scope, it is just called in the pages as is: like #paraFormat2(data)#, how can i achieve the functionality of this functions to be avaliable without modifying the whole legacy app here is an Example of What i am trying
    Copy code
    <cffunction name="OnRequest">
    <cfinclude template="custom.cfm">
    </cffunction>
    custom.cfm
    Copy code
    <cffunction name="convert" returntype="numeric">
    	<cfargument name="argText">
    	<cf_calculate data="#argText#" key="500">
    	<cfreturn Val(calculate.value)>
    </cffunction>
    all i am getting is an empty Page, if i exclude the function onrequest, i get a page but it starts throwing errors
    d
    c
    • 3
    • 14
  • a

    Aasif

    02/21/2022, 10:09 PM
    Hi all, I have an issue with Lucee if the cfml file is larger than 64KB. This shows a "Method code too large" error. Is there any solution to that kind of error? I have attached the screenshot below.
    m
    z
    • 3
    • 6
12345...38Latest