Skip navigation
Khaled_E
Currently Being Moderated

CF Builder freezing when I edit a particular file

Feb 16, 2012 11:35 PM

I recently started using CFB 2. Going into an old application and editing some of its files, I noticed that it freezes repeatedly with a particular file. It uses the old cfx_image and I was updating it to use CFIMAGE at multiple loctions within the file.  Not sure what might be going on. Text of the file is attached.

Thanks

Khaled

 

=======================

<cfinclude template="../ActLockEnforce.cfm">

 

<!--- THIS PAGE USES CFX_IMAGE --->

<!--- CREATES THUMBNAILS ON THE FLY AND SPECIFIES THE SIZE --->

 

<cfmodule template="../tags/autoresize.cfm" filefield="PicFile"  imagepath="#ExpandPath('../picFiles/')#" thumbpath="#ExpandPath('../ThumbsFiles/')#" thumbsize="150">

<!--- maxsize="450" --->

 

 

<!--- IF THE PICTURE FILE IS TOO BIG, SOUND A WARNING AND ROLLBACK THE WHOLE PROCEDURE --->

<!--- DEBUG: checkignsize <br> --->

<cfif  photoSize GT (request.picSize*1000)>   

<!--- DEBug: pic too big<br> --->

    <cfset size = photosize\2000>

    <cfset d =

     <!--- <cfoutput >#expandpath('../pic/#photo#')#<br>

    size is #size#</cfoutput>

    <cfabort>  --->

    <!--- debug: deleting pic & thujmb<br> --->

    <cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#"> 

    <cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">     

        <cfoutput>

            <script>

            alert('Your uploaded file was #size# KB. \n The maximum file size you can upload is #request.picSize# KB. \n Your operation has been cancelled')

            </script>

        </cfoutput>

    <cfinclude template="../queries/qryGetCategories.cfm">

    <cfset attributes.fuseaction="UpLoadForm">

    <cfinclude template="index.cfm"    >

<cfelseif TheWidth LT request.minwidth><!--- if the picture is too narrow, stop --->

<!--- debug: picture too narrow<br> --->

    <cffile action="DELETE" file="#expandpath('../picFiles/#photo#')#">

 

    <cffile action="DELETE" file="#expandpath('../ThumbsFiles/#photo#')#">

 

        <cfoutput>

            <script>

            alert("The width of the uploaded picture is #TheWidth# pixels, too small for display. \n The minimum width required is #request.minwidth# pixels. \n Please resize your picture and upload again. \n Your operation has been cancelled ")

            </script>

        </cfoutput>

    <cfinclude template="../queries/qryGetCategories.cfm">

    <cfset attributes.fuseaction="UpLoadForm">

    <cfinclude template="index.cfm"    >

<cfelse><!--- if the picture size is ok, insert the water mark logo5  --->

<!--- debug: putting water mark<br>

    <CFX_IMAGE

        ACTION="PASTE"

        FILE="#expandpath('..\graphics\logo5.gif')#"

        TO_FILE="#expandpath('..\PicFiles\#photo#')#"

        OUTPUT="#expandpath('..\PicFiles\#photo#')#"

        x="0"

        y="0"

        transparent="yes"

 

        origin="top">  --->

 

    <cfimage action="read" name="thephoto" source="#expandpath('..\PicFiles\#photo#')#" >

 

 

    <!--- insert into PIX table --->

    <!--- "TheWidth comes from cfx_image in the AutoResize Custom tag --->

 

    <cflock timeout="2" throwontimeout="No" type="READONLY" scope="SESSION">

        <cfset memberID = session.memberID>

    </cflock>

    <cfmodule template="../tags/max_ID.cfm"

        datasource="#request.DSN#"

        tablename="pix"

        primarykey="picID">

    <cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPic" datasource="#request.dsn#" >

        INSERT into pix (picID, PicFile, PicThumbFile, CategoryID, OwnerID,

        forSale, StatusID, DatePosted,PicTitle, PicInfo, width, height )

        VALUES             (#max_id#, '#photo#', '#photo#', #CategoryID#, #memberID#, #forSale#, #request.newstatus#, #CreateODBCDateTime(Now ())#, '#HTMLEditFormat(PicTitle)#', '#HTMLEditFormat(PicInfo)#', #TheWidth#, #TheHeight#)

    </cfquery>

 

 

    <!--- insert a blank line in the VOTESPIX table so you can retrieve pictures, even if the picture does not have any votes in queries/ActSearch.cfm --->

 

    <cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="insertvote" datasource="#request.dsn#" dbtype="ODBC">

        INSERT into VotesPics (picID )

        VALUES (#max_id#)

    </cfquery>

 

    <!--- save max_id before getting new values for KeyWords and Prices --->

    <cfset newPicID = max_ID>

 

    <!--- insert keywords --->   

 

    <cfloop index="word" list="#attributes.keywords#" delimiters=" ,">

        <cfmodule template="../tags/max_ID.cfm"

            datasource="#request.DSN#"

            tablename="KeyWords"

            primarykey="KeyWordID">   

        <cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="actInsertKeywords" datasource="#request.dsn#" dbtype="ODBC">

            INSERT into KeyWords (KeyWordID, PicID, KeyWord )

VALUES (#max_id#, #newPicID#, '#word#')

        </cfquery>

    </cfloop>

 

<cfif attributes.forSale is 1><!--- if picture is for sale, insert prices --->

    <cfloop index="sizenumber" from="1" to="#numberOfSizes#">

        <!--- <cfif val(attributes.price#sizeNumber#) GT 0> --->

 

            <cfmodule template="../tags/max_ID.cfm"

                datasource="#request.DSN#"

                tablename="prices"

                primarykey="priceID">

 

            <cfquery username="#request.SQLusername#" password="#request.SQLpassword#" name="ActInsertPrices" datasource="#request.dsn#" dbtype="ODBC">

            INSERT into prices (priceID, PicID, sizeID,price )

    VALUES (#max_id#, #NewPicID#, #sizeNumber#, #evaluate('attributes.price' & sizeNumber)# )

            </cfquery>

        <!--- </cfif> --->

    </cfloop>

</cfif>

    <!--- start setting parameters for history insertion --->

    <!--- memberID defined above in the session lock --->

    <cfset ztransaction = "upload">

    <cfset PicID = newPicID>

    <!--- <cfif request.costPerPic GT 0 and enforce>if pictue upload is not free --->

        <!--- set transaction value to picture upload price

        <cfset ztransactionsum = request.costPerPic>--->

        <!--- increase number of pix uploaded --->

        <!--- <cfinclude template="../queries/ActIncrementPixUploaded.cfm"> incrment when approved, not when uploaded

 

    <cfelse>

        <cfset ztransactionSum = 0>

    </cfif>--->

    <!--- deBUG POINT: inserting histroy<BR> --->

    <!--- <cfinclude template="../admin/ActInsertHistory.cfm"> No more hx for upload--->

    <cfinclude template="DspUploadLanding.cfm">

</cfif>

 

 
Replies
  • Currently Being Moderated
    Feb 17, 2012 12:10 AM   in reply to Khaled_E

    Do you see any errors in the erro log when CFB freezes? If error log view is not already opened, you can open it by invoking menu Window->Show View->Other->General->Error Log.

     

    -Ram

    ColdFusion Builder Team.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 17, 2012 2:56 AM   in reply to Khaled_E

    Can you post details of  ' Unhandled event loop exception' error, like stack trace?

     

    -Ram

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 17, 2012 3:12 AM   in reply to Khaled_E

    This is a bug and caused by cyclic inclusion of cfm files (e.g. a includes b and b includes a). CFB does not check conditional statments in the code before processing included files. We are in the process of fixing this issue

     

    -Ram

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 18, 2012 4:02 PM   in reply to Khaled_E

    Khaled, the error is not in CF but in CFB (two entirely separate processes). Though sometimes CFB does communicate to CF, in this case the error you quoted in the previous message (which was from the CFB error log) means it’s happening in CFB. So restarting CF has nothing to do with the problem.

     

    Ram suspected it might be a circular reference problem, and he’s right: the “stackoverflow” and the hundreds of repeating line pairs in the stack trace you shared is confirmation.

     

    As for if it will be with certain files, likely yes. It’s about code in one file including another, that then calls the original, and so on.

     

    To be clear, the problem does not happen when you run your page, because as he said the problem in CFB is about it not taking into account coding logic you have that would prevent it happening at runtime. CFB, being an editor, is not “running” your code. They do scan the code, to enable various features to help you in development. This is just one place where you’ve tripped over a known bug. Hopefully you’ll hear again here if/when it’s fixes.

     

    Hope that’s helpful.

     

    /charlie

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points