10 Replies Latest reply: Jun 30, 2015 7:36 AM by 1ce7ea RSS

    Error: Making this change would require changing code that is locked....

    christinett Community Member

      DWCS3

       

      Rebuilding site -- I know this is a common problem, but what are the steps to resolve it?

       

      Error: "Making this change would require changing code that is locked by a template or a translator.  The change will be discarded."

       

      Click OK and the change is made anyway, oftentimes resulting in loss of document CSS and dynamic code, which is then unretrievable. EXTREMELY FRUSTRATING!!!

       

      There is another code at the top of all documents using the template:

      "<!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->"

      However, this line has always been in my previous documents and created no problem.

       

      The oddest thing is, I can be in an editable region of a document, click on an image to edit in Fireworks, edit, click DONE and it comes back in DW with that error. ???

        • 1. Re: Error: Making this change would require changing code that is locked....
          mytaxsite.co.uk MVP

          You haven't told us whether your pages were created using a template and that you are trying to edit the template when you get this error.  Please post an expurgated version of your code for people to see what is the status of your code that is causing the problem.

          • 2. Re: Error: Making this change would require changing code that is locked....
            christinett Community Member

            Since I'm rebuilding the site, I copied the original template, tweaked it with new external CSS, renamed ONE editable region  (which include a lot of the head), and applied it to copies of all my documents.  Of course, the renaming of the editable region in the head DID create havoc when I applied it to my copied documents.  I lost all in-document CSS and some dynamic code. Realizing my HUGE mistake, I could luckily copy CSS/code from backup into the head of the new documents.  I've been working for some time with these new pages fairly well, but it's been a problem with this error popping up sometimes, and only occassionally dumping code.

             

            When the error occurs, it is when I'm trying to edit a document from the redesigned template.  Doesn't seem to happen when I'm editing the template itself.  I don't want my code public, but can give an example with some generics. What is "expurgated" version of code?

             

            • 3. Re: Error: Making this change would require changing code that is locked....
              MurraySummers ACP/MVPs

              Error: "Making this change would require changing code that is locked by a template or a translator.  The change will be discarded."

               

              This message is often a red herring.  It usually means "oops, I have found an error on your page".  It may actually have NOTHING to do with editable or non-editable regions, and may in fact even refer to a CSS error rather than an HTML error.  The first stop is the validator - does this page validate?

               

              Click OK and the change is made anyway, oftentimes resulting in loss of document CSS and dynamic code, which is then unretrievable. EXTREMELY FRUSTRATING!!!

               

              This error message itself does not do this. We need to understand what error triggered it to understand what is happening further.

               

              There is another code at the top of all documents using the template:

              "<!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->"

              However, this line has always been in my previous documents and created no problem.

               

              That line is normal and should be present in all template child pages.

              • 4. Re: Error: Making this change would require changing code that is locked....
                christinett Community Member

                Good to know that the code at the top is normal.   Thank you for clarifying these issues.

                 

                Except for one unclosed img tag (?) in my footer, my template markup validates fine.  Validating as XML does bring up this error:

                An exception occurred! Type:NetAccessException, Message: Could not open file: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[xml]

                But I've never touched that line, so I doubt it has anything to do with my issue.

                 

                I'm going to spend a good portion of today going over my templates for anything odd.  I'll try to note the exact steps I took if and when this issue arises and report back.

                We need to understand what error triggered it to understand what is happening further.

                 

                I'm not sure how to provide this when there are no visible errors prior to the resulting error.  Nothing odd triggers or leads up to the resulting error, it just happens and then I know I've got a problem.

                • 5. Re: Error: Making this change would require changing code that is locked....
                  MurraySummers ACP/MVPs

                  How many templates do you have?  This is all from one site, right?  How many total pages are there in the site?

                   

                  Would it be possible to see the code on the offending template page, and to know what changes you made to trigger the red-herring alert?

                  • 6. Re: Error: Making this change would require changing code that is locked....
                    christinett Community Member

                    I have two templates, one site.  I'm working toward converting all my pages to the new template format by copying files and renaming them first, not overwriting them.  I have about 22 pages, but will have more (or less!).

                     

                    The pattern seems to be when I click on an image on a page:

                     

                    1. Click the image

                    2. Click the FW icon in Properties to open FW and edit the image

                    3. Edit the image in FW, then click DONE

                    4. Switches back to DW where the error pops up

                    5. Only choice is to click OK

                    6. FW image takes on edits but data gets lost

                     

                     

                    Besides that and probably more importantly, I'm now discovering that my problematic editable region keeps moving it's endi tag and even moved the doctitle end tag in the documents using the template.  See, I have an editable region in the head where I can manage scripts and in-document CSS on any given page.  I had this area in my previous documents and they all worked fine.  For some reason though, these new templates aren't behaving properly, and scripts are getting shoved within and out of that editable region.  I've got a complete MESS!

                    • 7. Re: Error: Making this change would require changing code that is locked....
                      christinett Community Member

                      Looking at DW preferences, I found two Fireworks editors listed for .png, .gif, and .jpg.  Maybe that was causing a problem.

                       

                      Don't know if this will help, but....

                      Here is sort of what my template code looks like:

                       

                       

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml">
                        <!-- DW6 -->
                              <head>
                             <!-- TemplateBeginEditable name="meta" -->
                        <meta name="keywords" content="blah blah blah" />
                        <meta name="description" content="blah blah blah/>
                        <meta name="robots" content="noarchive, nofollow" />
                        <meta http-equiv="pragma" content="no-cache" />
                        <meta http-equiv="cache-control" content="no-cache" />
                        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                        <meta name="google-site-verification" content="8KWIMcjzjngBlH7XsAnwF4W5M_novbbavDYWk2YIZgk" />
                        <link rel="shortcut icon" href="/favicon.ico" />
                                <!-- TemplateEndEditable -->
                          <!-- TemplateBeginEditable name="doctitle" -->
                        <title>document title</title>
                                <!-- TemplateEndEditable -->          
                                      <!-- TemplateBeginEditable name="stuff" -->
                                      <link href="../CSS/file.css" rel="stylesheet" type="text/css" />
                                      <link href="../CSS/file.css" rel="stylesheet" type="text/css" />
                      <script type="text/javascript">
                      <!--
                      function MM_openBrWindow(theURL,winName,features) { //v2.0
                        window.open(theURL,winName,features);
                      }
                      function MM_popupMsg(msg) { //v1.0
                        alert(msg);
                      }
                      //-->
                      </script>
                              <!-- TemplateEndEditable -->
                      </head>

                       

                       

                       

                      Here's code from a document using the template:

                       

                        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                        <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/main.dwt" codeOutsideHTMLIsLocked="false" -->
                        <!-- DW6 -->
                              <head>
                             <!-- InstanceBeginEditable name="meta" -->
                        <meta name="robots" content="noarchive, nofollow" />
                        <meta http-equiv="pragma" content="no-cache" />
                        <meta http-equiv="cache-control" content="no-cache" />
                                <!-- InstanceEndEditable -->
                          <!-- InstanceBeginEditable name="doctitle" -->
                      <title>my document title</title>

                      <script type="text/javascript">
                      function toggleMe(a) {
                      var e=document.getElementById(a);
                      if(!e)return true;
                      if(e.style.display=="none") {
                      e.style.display="block"
                      }
                      else{
                      e.style.display="none"
                      }
                      return true;
                      }
                      </script><!-- InstanceEndEditable -->          
                                      <!-- InstanceBeginEditable name="stuff" -->
                                      <link href="CSS/file.css" rel="stylesheet" type="text/css" />
                                      <link href="CSS/file.css" rel="stylesheet" type="text/css" />
                              <script type="text/javascript">
                      <!--
                      function MM_openBrWindow(theURL,winName,features) { //v2.0
                        window.open(theURL,winName,features);
                      }
                      function MM_popupMsg(msg) { //v1.0
                        alert(msg);
                      }
                      //-->
                      </script>

                        <style type="text/css">
                      <!--
                      .blahblahblah {
                      padding: 0 100px 20px 125px;
                      line-height: 1.3em;
                      }

                      .blehblehbleh {
                      font-family: Arial, Helvetica, sans-serif;
                      font-size: 13px;
                      color: #006666;}

                      -->
                                       </style>
                      <!-- InstanceEndEditable -->
                      </head>

                      • 8. Re: Error: Making this change would require changing code that is locked....
                        MurraySummers ACP/MVPs

                        Are you using DMX (6.0) for this work?  If so, please update it to version 6.1 using the updater on the Adobe site.  There were a number of problems with 6.0 that could be causing issues such as this....

                        • 9. Re: Error: Making this change would require changing code that is locked....
                          christinett Community Member

                          I'm using DW CS3.  I've since cleaned up my templates, but again, this problem seems to only happen when I open up an image on any page, from DW to edit in FW.  The problem obviously exists within both templates, or there's a communication issue between DW and FW.  SO bizarre.... The error message says "...locked by a template or a translator" -- what is a translator?

                           

                          Would this article's suggestion be worth a try?  If so, will renaming the config file do anything harmful? Where do I find the file in Vista?

                          http://www.aarongloege.com/blog/web-development/dreamweaver-translator-error-fix/

                           

                          Message was edited by: christinett

                          • 10. Re: Error: Making this change would require changing code that is locked....
                            1ce7ea Community Member

                            In case it helps a googler...

                             

                            For me, I had to move an <!-- #include> out of the head, as an extension I made would throw this error when attempting to add a <link> to the head.

                             

                            What tipped me off was information from this thread.