We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33372
    • 1,611 Posts
    Is there any real need for the dirty var in this code anyway? Couldn’t we just assume that if someone clicks the Save button that the info should be updated? It seems to me that the dirty var is useful if you click another link without saving, but I don’t think it’s necessarily helpful when Save has been clicked.

    Perhaps this is irrelevant in the 0.9.7 code anyway...
      "Things are not what they appear to be; nor are they otherwise." - Buddha

      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      One thing the dirty var allows is for the prompt/confirmation when you try and leave a page, but haven’t saved changes yet. I know this feature is helpful to me...

      To chime in, I am still experiencing this behavior even in 096RC3, and for me, it is mainly with RTE and Textarea (regular and mini).

      The best work around I have found is to update via QuickEdit on the front-end...never fails.
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 33372
        • 1,611 Posts
        Quote from: pixelchutes at May 15, 2007, 12:24 PM

        One thing the dirty var allows is for the prompt/confirmation when you try and leave a page, but haven’t saved changes yet. I know this feature is helpful to me...
        Right. It is useful for that, but there’s no need to check it when saving that I can think of. Seems like an easier fix than I thought it would be as well.
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 22098
          • 218 Posts
          so is there a quick-fix for 0.9.5 to solve this? We have a frustrated customer bugging us smiley

          Olaf
            • 33372
            • 1,611 Posts
            I have a potential fix that you should test before setting it loose on a live site (maybe Raymond can chime in and help us here also).

            Around line 172 of manager/processors/save_content.processor.php you should find:
                  // save value if it was mopdified
                  if (in_array($row['name'], $variablesmodified)) {
            


            I changed this to:
                  // save value if it was mopdified
                  //if (in_array($row['name'], $variablesmodified)) {
                  if (true) {
            


            and things still seem to work properly...

            Basically, there’s a hidden form field in manager/actions/mutate_content.dynamic.php called variablesmodified that has each var added to it by JavaScript when they’re changed. Changing a variable by choosing autotext doesn’t seem to trigger this event, so these vars aren’t added to that array. This is the code that checks that a TV is in the variablesmodified array before updating its value.

            I’d certainly like to see this evaluated by the authors of the original code before dispensing wholesale with a check that was probably there for a reason, but if the reason was just to reduce database queries and it causes this autotext issue then perhaps this is a necessary hack.
              "Things are not what they appear to be; nor are they otherwise." - Buddha

              "Well, gee, Buddha - that wasn't very helpful..." - ZAP

              Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
              • 22098
              • 218 Posts
              In 0.9.5 it doesn’t seem to solve things...at least not when i simply change some image tag attributes inside the image editor of TinyMCE. I still have to click inside the TinyMCE editor field to make things updated when saving.

              Olaf
                • 33372
                • 1,611 Posts
                Hmm... This fix is only for TVs. Are you refering to a rich text TV, or the main content field?
                  "Things are not what they appear to be; nor are they otherwise." - Buddha

                  "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                  Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                  • 22098
                  • 218 Posts
                  rich text TV
                    • 33372
                    • 1,611 Posts
                    It seems to work for me. On this test site I am running 0.9.6 RC2 with TinyMCE 2.1.0. Let me make sure that I’m doing the same thing as you, however...


                    • I created a rich text TV
                    • I inserted an image into it and then saved the document
                    • I edited the document again, and without clicking anything else I right-clicked on the image in the rich text TV and chose Image Properties
                    • I changed the image description in the popup and clicked Update
                    • Then I saved the document again (and the updated info was saved)

                    The problem that I had been having (choosing previously-entered autotext in regular text TVs didn’t save that info) also seems to be corrected now for me.
                      "Things are not what they appear to be; nor are they otherwise." - Buddha

                      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

                      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                      • 22098
                      • 218 Posts
                      we’re using about 7 rich text TV’s for the same template..maybe that’s the reason?

                      Olaf