We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22980
    • 84 Posts
    Hi

    How should I disable the Locks functionality?

    My client wants to be able to upload multiple (any number) of ’attachment’ files to a page. How would you do this? Would there be a way with the File TV?

    (Evo 1.0.2)

    Thanks
      • 7231
      • 4,205 Posts
      The locks are to prevent multiple admins working ont he same page. In general the locks will reset once you are done editing or when you log out. However sometimes they will get stuck. In this case go to the manager and select on the main menu TOOLS. In the sub menu there is an option Remove Locks. This will reset the locks.

      There is no way to do a multiple number of attachments that I am aware of. What I have done in the past is create a large number of TVs (lets say 10) which would become the max number of attachments. Since MODx only records TVs with values the unused ones will not weigh down the database. Then in the visual interface you can use some sort of logic operator, either PHx or a snippet to only display if there is a value and display nothing if no value.

      Hope this helps.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 22980
        • 84 Posts
        For the locks I actually meant disable the locks functionality altogether, not to simply use the disable locks tool.

        For the attachments, that seems like a good idea.. I’ll definitely look in to in the morning.

        Thanks!
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Why would you want to do that? If I am editing a page, and you log in and start editing the same page, we’ll overwrite each others’ edits. Because that is a Very Bad Thing, MODx keeps track of who is doing what and "locks" it for anyone else.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 22980
            • 84 Posts
            I believe for this site there is either only one editor or the coordinate efforts and only apply updates once. Also, there are multiple editable resources connected with each page, so there is good reason to have multiple people editing a page. On to of that, multiple people may want to view the different data associated with a resource, and so need to open the page at once. Finally, the Locks system doesn’t always work - I’ve had it where I finish work on something and a few hours later someone hits a lock on a page I was on.

            There are lots of good reasons.
              • 25663 MODX Staff
              • 12,272 Posts
              phrlich, if that’s the case then there is something not right in your environment. The manager only locks the specific Resource (web page) on which you’re working. If you have two folks editing two different areas at the same time, say the [*content*] and another the [*sidebar-column*], the last one to save will essentially and actually revert the other’s work.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                My point exactly. I log in and open a document to make changes to the content. Meanwhile, you log in and open the same document to make changes to a TV. You open the document before I have saved my changes to the content, so you get the original content. I save my changes and log out. You finish up your edit to the TV and save...with the original content still there, since your copy has no way to know that I’ve changed it. That’s what locks are for.

                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org
                  • 22980
                  • 84 Posts
                  rthrash : Actually when I said that there are multiple editable resources on a page, thats what I meant.. I have tabs added and custom database tables which can be edited completely independently of the MODx save feature. Maybe this counts as ’not quite right’, but its what I want.

                  sottwell: I do realize the implications of this and have in fact already been over all this in detail with my client.

                  The point is, I need to have locks removed, does anyone have advise on this before I start madly haxxoring the core?
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Hack away. That’s the only way you’ll break the functionality.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 22980
                      • 84 Posts
                      Sweet. I’ll let you all know how it goes!