We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 53827
    • 7 Posts
    Description of Request: database table columns to add

    Steps to Reproduce: Creating/Saving a Resource or Element in the Manager

    Expected Outcome:

    I would like to see created and a modified columns on the following database tables when creating or updating a Resource or Element from within the Manager, please:

    modx_site_content
    modx_site_htmlsnippets
    modx_site_plugins
    modx_site_plugin_events
    modx_site_snippets
    modx_site_templates
    modx_site_tmplvars
    modx_site_tmplvar_access
    modx_site_tmplvar_contentvalues
    modx_site_tmplvar_templates
      • 3749
      • 24,544 Posts
      The best place for feature requests is here: https://github.com/modxcms/revolution/issues. If you post them in the Forum, they often slip through the cracks.

      If I'm understanding you, you want the 'createdon' and 'editedon' fields of the resource displayed on the Create/Edit Resource panel and the Create/Edit Snippet, Plugin, Chunk, Template, and a bunch of other places.

      For resources, you might take a look at NewsPublisher. It works in the front end only, but I think you could display those fields.

      You could display those fields in the Manager with a plugin (especially if you want them read-only). Look at the ClassExtender code to see how to do it.

      It's also possible that you could do it for Resources with Form Customization, but I don't think so.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 53827
        • 7 Posts
        Quote from: BobRay at Oct 13, 2017, 11:01 PM
        The best place for feature requests is here: https://github.com/modxcms/revolution/issues. If you post them in the Forum, they often slip through the cracks.
        Thank you pointing me in the right direction for posting Feature Requests.

        Although displaying the created/modified dates on the front end would be useful, I have a different reason for wanting those fields added to the database tables.

        Working in a multiple developer/admin site and deployment workflow (sandbox>dev>staging>production), I find having these columns available beneficial. Not only to track my own creation/updates of resources and elements, but to track what the other people involved have contributed to make sure nothing gets lost throughout the deployment process.

        In short, I would like to see when a row is added to the resource and element tables, as well as the dates they were modified.

        VersionX does a nice job of storing previous versions of updated resources and elements, but I believe having these columns added would be powerful by itself.
          • 3749
          • 24,544 Posts
          I just finished a blog post about how to display the hidden resource fields in the Manager. It should be published in the next day or two.

          As for adding those columns to the DB for elements, I'm with you 100 percent. I've wanted them for some time. I'd add createdby, createdon, editedon, editedby, deletedon, and deletedby (to match the modResource fields) to all elements. They could be written or updated in the save() method of the modElement class.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 53827
            • 7 Posts
            Quote from: BobRay at Oct 16, 2017, 05:35 PM
            I just finished a blog post about how to display the hidden resource fields in the Manager. It should be published in the next day or two.
            I'll keep my eye open for that!

            Quote from: BobRay at Oct 16, 2017, 05:35 PM
            As for adding those columns to the DB for elements, I'm with you 100 percent. I've wanted them for some time.
            We have to keep up the good fight. It is becoming or has become a necessity and not just IMO.
              • 3749
              • 24,544 Posts
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 53827
                • 7 Posts
                Quote from: BobRay at Oct 17, 2017, 10:36 AM
                Here you go: https://bobsguides.com/blog.html/2017/10/17/displaying-hidden-resource-fields/. smiley
                Thank you sir!