Skip to main content
Participant
June 8, 2009
Question

dreamweaver cs4 moving/breaking code!

  • June 8, 2009
  • 12 replies
  • 6770 views

Hi,

Could someone please shed some light on the following - it must be a bug. I have disabled code rewriting in dreamweaver cs4 for mac, yet it continues to shift my code around.

example test.cfm:

<cfswitch expression="#template.section#">
    <cfcase value="head">

    <style type="text/css">
     .footer { margin-bottom:30px; text-align:center; }
    </style>
       
    </cfcase>
    <cfcase value="body">

    <table>
     <tr>
      <td></td>
     </tr>
    </table>

    </cfcase>

</cfswitch>

-----------------------

Pretty simple code, yet if I OPEN that in DW cs4 on mac, it moves the last cfcase to the end of the code and therefore breaks the code - like so:

<cfswitch expression="#template.section#">
     <cfcase value="head">

    <style type="text/css">
      .footer { margin-bottom:30px; text-align:center; }
     </style>
        
     </cfcase>
     <cfcase value="body">

    <table>
      <tr>
       <td></td>
      </tr>
     </table>

</cfswitch>

</cfcase>

-------

This happens with several of my templates - DW for me is unusable like this...

thanks.

    This topic has been closed for replies.

    12 replies

    Participant
    August 8, 2011

    This problem has been around since Dreamweaver 3 ... It's drove me nuts for years! And it's intermittant ... It makes absolutely no sense. Why can't Adobe fix this?

    Inspiring
    August 8, 2011

    Why can't Adobe fix this?

    We. Don't. Know.


    This is not a DreamWeaver forum.  It is a ColdFusion forum.  Whilst both are Adobe products, they really have very little to do with each other.

    Furthermore, this is a community forum, not a support channel: Adobe do not monitor these forums, do not take support requests from these forums, and it is not the DreamWeaver bug tracker.

    So bleating about this issue here is - respectfully - not a good use of your time.

    I tried to find a DW bug tracker, but I drew a blank.

    Maybe give Adobe support a call and ask them (but, err... good luck with that... at least as CF support goes, they are not noted as being very proficient at giving support, based on reports back to here about people's experiences).  Possibly even ask on a DW forum if anyone has heard anything about a fix or a work-around.  This thread is quite old, after all...

    --

    Adam

    RandJer
    Participant
    April 7, 2010

    Count me in as having this same problem

    Save This

    <cfloop query="machines">
                        <td><input type="checkbox" name="machine" value="|#machines.machineid#|" <cfif listfind(partinfo.machine,"|#machines.machineid#|")>checked</cfif>> #machines.machinename#</td>
                        <cfif machines.currentrow mod 2 is 0>
                              </tr><tr>                   
                        </cfif>
                </cfloop>

    Reopen to this

    <cfloop query="machines">
                        <td><input type="checkbox" name="machine" value="|#machines.machineid#|" <cfif listfind(partinfo.machine,"|#machines.machineid#|")>checked</cfif>> #machines.machinename#</td>
                        <cfif machines.currentrow mod 2 is 0>
                        </tr><tr>                   
                       
                </cfloop></cfif>

    I've tried this with both the option checked and unchecked, this is with CS3.

    Add this to cfquery not closing tags on me since I applied the CF9 stuff and Eclipse is starting to look much better

    Participant
    May 19, 2010

    I have the same issue as well.  It is amazing so many people have had this issue for so many years and they still cannot simply leave our code alone when opening a file. Adobe please fix this as it is a major bug.

    Inspiring
    June 9, 2010

    I too have this problem. < tr> tags are added in templates that

    use complex loops to create tables.


    Participating Frequently
    March 15, 2010

    FWIW this is not a new bug for Dreamweaver - in looking at my Support portal I have the exact same error submitted July 16, 2007 for CS3 (incideindially it is marked unresolved).

    Likewise I had the problem on UltraDev -- however that one was fixed by editing one of DW's js files.

    Participating Frequently
    March 15, 2010

    This thread's been around for a long time, but I just came across it, and have to add that I have yet to find any solution to this bug, which makes Dreamweaver unusable in instances like these. No updates? No response from Adobe? With CS5 due out, and the expectation that we will all upgrade, it's a shame to see something like this unresolved.

    Inspiring
    March 15, 2010

    I assume that Adobe is just telling us that if you want to use ColdFusion (CF), you need to use Eclipse, Builder or another tool. I plan on using Builder whenever my client approves it and CF9 for our environment, but that may be awhile. My recommendation is for people who use CF to not use Dreamweaver (DW), and if they do use DW, to avoid conditional code that DW has problems with. I have only 1 page that I KNOW OF for which I have a warning statement on for  developers to perform certain actions if they make a change to the code. I now avoid coding like I did that one time. Even though it was more efficient code, it was a bit complicated for a different developer to follow anyway. That said, the thought that Adobe allows DW to do this is ridiculous and would cause me never to recommend that tool to anyone, whether they use CF or not. This should have been fixed long ago. Unfortunately I am still using the latest version of DW CS4 with the latest updates on Windows XP. I hope to get off it this year.

    ilssac
    Inspiring
    March 15, 2010

    I think so of the problem is that many of us you Dreamweaver just fine, and it does not do anything to our code.

    At least that is true for me.

    Participant
    December 4, 2009

    Just wanted to add another voice to this legitimate concern.

    Dreamweaver CS4 is adding a <tr > to my code like others have mentioned.

    At first, I couldn't believe it was happening. It must also save the file right away because just opening and closing the file adds the unwanted <tr >.

    I'll have to continue my work with Eclipse. I just can't trust Dreamweaver anymore. What if it changes critical code in a large file? Unacceptable.

    But seriously, what kind of editor in programmer mode would ever disrespect a programmer like this?

    Very sad. Have lost respect for Adobe, yet again.

    October 21, 2009

    I am also having this same problem with Dreamweaver CS4.  I have code rewriting turned OFF in the preferences, yet Dreamweaver continues to modify code each time it opens a file.

    This is especially problematic because I work with other programmers and DW hacks up their work so badly that they have demanded that I do NOT use Dreamweaver when editing any of their pages!  I now have to use Text Edit (on my Mac)

    So, I spent $400 for this brand new DW and I'm using Text Edit.

    ADOBE --- Dreamweaver needs to be able to open any file WITHOUT making any changes to that file!  It doesn't matter if the code is "deprecated" or incorrect --- just open the file "as is" and allow the user to decide what to change or not change. Very simple.

    Participant
    October 6, 2009

    The problem is actually that one of the settings of Dreamweaver is not working properly per the documentation.  Under Edit->Preferences->Code Rewriting, the "Never rewrite code" option is always marked as on with a list of file extenstions that are associated to it.  It appears that this feature is not working correctly, at least for .cfm files as these are all I have to test with, in the current version of Dreamweaver.  Per the help documentation, this option should prevent Dreamweaver from rewriting any code in file extensions that are associated with this option.  By default, .cfm is listed in this box.

    From http://help.adobe.com/en_US/Dreamweaver/10.0_Using/WSc78c5058ca073340dcda9110b1f693f21-7bdaa.html

    Use the code rewriting preferences to specify how and whether Dreamweaver modifies your code while opening documents, when copying and pasting form elements, and when entering attribute values and URLs using tools such as the Property inspector. These preferences have no effect when you edit HTML or scripts in Code view.

    ...

    Never Rewrite Code: In Files With Extensions
        Allows you to prevent Dreamweaver from rewriting code in files with the specified filename extensions. This option is particularly useful for files that contain third-party tags.

    Here is an example to show what is happening.  I added this code to a test page and then saved and closed the file.  I ran the file on my server and it displays correctly:

    <table border="1">
        <tr>
          <td rowspan="5">Table</td>
        <cfloop from="1" to="5" index="x">
          <cfif x neq 1>
              <tr>
          </cfif>
            <cfloop from="1" to="5" index="i">
              <td><cfoutput>#x*i#</cfoutput></td>
            </cfloop>
          </tr>
          </cfloop>
    </table>

    Then, I reopened the file in Dreamweaver and the code has been changed to this:

    <table border="1">
        <tr>
          <td rowspan="5">Table</td>
        <cfloop from="1" to="5" index="x">
          <cfif x neq 1>
              <tr>
          </cfif>
            <cfloop from="1" to="5" index="i">
    ----->   <tr  ><td><cfoutput>#x*i#</cfoutput></td>
            </cfloop>
          </tr>
          </cfloop>
    </table>

    Dreamweaver is unable to determine what the containing <tr> tag is for this <td> tag and automatically adds a <tr> tag.  This should be prevented by the "Never rewrite code" setting, but it appears that it is not.  I have input a bug report stating that this setting is not functioning correctly.

    Participating Frequently
    August 21, 2009

    Add me to the list of people seeing broken code.  It's very frustrating.  I created a ticket with Adobe - and after being given the runaround they told me to delete my preferences file.  Needless to say that didn't help.

    August 5, 2009

    I had the same problem back when CS4 first came out. I contacted Adobe about the issue and got the run around for about for 3-4 month.  Finally I just had to move back to CS3  and have been using it since. 

    There claim for me was that the code was incorrect. (I don't care if my code is incorrect or not don't move tags around on me it is causing errors everytime i turn around !!!!!)

    byrningAuthor
    Participant
    August 5, 2009

    it is rather pathetic! - I reported the issue several times when CS4 first came out (oct 2008 or so) - a year later and still no update. How difficult is it to release a hotfix, Dreamweaver CS4 is unusable in its current state.

    Inspiring
    August 4, 2009

    Hi,

    Did you check the "Make document XHTML compliant" when you initially created your template?.

    Inspiring
    August 4, 2009

    Speaking for myself, I probably created a default CFM with the Doctype setting of XHTML transitional and then I delete all the created code and started from scratch. To see if this had any affect, I created a new CFM selecting Doctype setting of "None", copied and pasted my code into this new template and removed the added <tr  > that it added, saved and closed and reopened the file and the evil <tr  > is back again in 3 places.

    The code I am using here is not displayed directly. It is an intermediate page that after a user chooses various report parameters on another CFM including whether to display the report as a PDF or Excel, they are sent to this particular CFM, which process the results calling CFCs and then outputing the results in the desired format. This intermediate CFM is used for multiple reports. The problem occurs within the Table structure below:

    ...

          <!--- Respectively blocks output of HTML that is outside cfoutput tags
          and suppresses debugging information that would otherwise
          display at the end of the generated page --->
          <cfsetting enablecfoutputonly="yes" showdebugoutput="no" />

          <!---Saves the generated content of the cfsavecontent tag,
          including the results of evaluating expressions and executing
          custom tags, in the specified variable. --->
          <cfsavecontent variable="lcResult">

          <!---Define Document Main Content --->
          <cfoutput>
            <HEAD>
            <TITLE>#pcTitle#</TITLE>
            </HEAD>
            <BODY>

            <!--- If output is a spreadsheet, embed the header, titles and subtitles --->
            <cfif vp_OutPut NEQ "Normal">
              #lcHeaderResult#
            </cfif>


            <TABLE border=0 cellpadding=0 cellspacing=0>  

       
                [Table rows and data are here using if-then-else logic, etc]


            </TABLE>
            </BODY>
          </cfoutput>
          </cfsavecontent>

    ...

            <cfheader name="content-disposition" value="attachment;filename=#DesiredReport#.xls" />


            <!---Sets the character encoding of generated output.
        Reset discards output that precedes call to cfcontent. --->
            <cfcontent type="application/msexcel" reset="yes" />


            <cfoutput>#lcResult#</cfoutput>
    ...