We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19388
    • 297 Posts
    Hi,
    VersionX looks so good. Here are some improvements and a possible bug.

    Compare does not work for me. The only error I get on error log is:
    [2011-01-11 04:49:53] (ERROR @ /assets/components/versionx/connector.php) Error 42S02 executing statement:
    Array
    (
    [0] => 42S02
    [1] => 1146
    [2] => Table ’carroza_web.extra_versionx’ doesn’t exist
    )


    Improvements:
    View details:
    - Show template name instead of ID
    - Show parent pagetitle instead of ID
    - Hide from menu & settings ( richtext, container... ): show yes/no instead 1/0
    - Published by: show username instead of ID.
    - PUblished on: shows only year, not full datetime

    Could be possible to show "compare" by default on doubleclick?

    Congratulations for your very nice job!

      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Thanks for reporting back!


      Hmm. When the table doesn’t exist, it can’t be saving anything to it either. But you are getting your revisions in the Components -> VersionX page? What is being sent to connector.php and returned to the script (Using Net panel on Firebug, or similar) when you click on Compare?

      Cross-posted those improvements to Github, thanks.

      I would personally think the default double click behaviour should be view details though. What do others think?
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 19388
        • 297 Posts
        It’s strange. First time it was showing revisions ( but not comparing ), but now it doesn’t show revisions. We made no changes and there are no new errors.
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          o.O?

          What’s the requests and responses doing to connector.php?

          And when editing a resource, it adds a new revision to the VersionX grid?


          If this is a test site, would you mind that I have a look in the manager and see this for myself? (could send me login details via a pm?)
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 19388
            • 297 Posts
            POST /assets/components/versionx/connector.php



            <b>Fatal error</b>: Call to a member function getOne() on a non-object in <b>/home/carroza/public_html/core/components/versionx/processors/getlist.php</b> on line <b>58</b>
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              Ah, got it!

              You probably added a resource after VersionX was installed... which is a scenario I didn’t test.


              This is the offending code:
              		// Fetch the userprofile matching the editedby field
              		$user = $modx->getObject('modUser',$rev->get('editedby'));
              		$userProfile = $user->getOne('Profile');
              		$name = $userProfile->get('fullname');

              It attempts to fetch the full name of the user id in the "editedby" field which, of course, is empty on a new resource.

              Changing the code to the following fixed it in my test case. Could you confirm this?
              core/components/versionx/processors/getlist.php, line ~57

              		// Fetch the userprofile matching the editedby field
              		$user = ($rev->get('mode') == 'new') ? $modx->getObject('modUser',$rev->get('createdby')) : $modx->getObject('modUser',$rev->get('editedby'));
              		//$user = $modx->getObject('modUser',$rev->get('editedby'));
              		$userProfile = $user->getOne('Profile');
              		$name = $userProfile->get('fullname');

              This first checks if it is a new resource.



              This does open up another possible scenario where the user that has edited a resource has been deleted, which would give the same error, still. Added this to the github issues and will push the inital fix for this issue later today.

              Fixed & pushed in commit 4e9d18d68e7c0fe050ae07547b800f53e0359a35 https://github.com/Mark-H/VersionX/commit/4e9d18d68e7c0fe050ae07547b800f53e0359a35

              German translation has also been added (thanks smooth-graphics!) in commit 0c100fa1662ce36a57095b3a127ffd7695fd2bc1 https://github.com/Mark-H/VersionX/commit/0c100fa1662ce36a57095b3a127ffd7695fd2bc1
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 19388
                • 297 Posts
                It works laugh
                Thanks!
                  • 18373 ☆ A M B ☆
                  • 3,141 Posts
                  Awesome smiley

                  Did that also fix comparing the resources, or is that still buggy?
                    Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                    Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                    • 19388
                    • 297 Posts
                    Compare results is still not working, this is what connector shows:

                    
                    
                    {"total":11,"results":[{"revision":11,"fromRev":9,"mode":"upd","time":"Tue 11 Jan, 2011 7:17","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2011,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":10,"fromRev":"","mode":"upd","time":"Tue 11 Jan, 2011 5:53","type":"document","contentType":"text\/html","pagetitle":"Patrocinan","longtitle":"Qui\u00e9nes nos acompa\u00f1an","description":"y nos apoyan","alias":"patrocinan","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"<p>Estas son las empresas que han colaborado con nosotros:<\/p><br \/>\r\n<p><a href=\"http:\/\/www.audiovisualescanarias.com\/\" target=\"_blank\">Audiovisuales Canarias<\/a><\/p><br \/>\r\n<p><a href=\"http:\/\/www.imprentaojeda.com\/\" target=\"_blank\">Imprenta Ojeda<\/a><\/p><br \/>\r\n<p><a href=\"http:\/\/www.gescargo.es\" target=\"_blank\">Ges Cargo<\/a><\/p><br \/>\r\n<p>Laboratorio de pr\u00f3tesis dental Luis Mart\u00ednez\u00a0<\/p><br \/>\r\n<p>Pamanil Servicios Inmobiliarios <\/p><br \/>\r\n<p> <\/p><br \/>\r\n<div id=\"mensajePatrocinador\"><br \/>\r\n<p><a class=\"m1\" href=\"mailto:[email protected]\">\u00bfQuiere ser patrocinador de<br \/>La Carroza?<\/a><\/p><br \/>\r\n<p><a class=\"m2\" href=\"mailto:[email protected]\">Contacta con nosotros<\/a><\/p><br \/>\r\n<\/div><br \/>\r\n<p> <\/p><br \/>\r\n<p> <\/p><br \/>\r\n<p> <\/p><br \/>\r\n<p> <\/p><br \/>\r\n<p> <\/p>","richtext":1,"template":2,"menuindex":5,"searchable":1,"cacheable":1,"createdby":1,"createdon":2010,"editedby":"Default Admin User","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2010,"publishedby":1,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":6},{"revision":9,"fromRev":8,"mode":"upd","time":"Tue 11 Jan, 2011 5:42","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2011,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":1,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":8,"fromRev":7,"mode":"upd","time":"Tue 11 Jan, 2011 5:41","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2011,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":1,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":7,"fromRev":6,"mode":"upd","time":"Tue 11 Jan, 2011 5:38","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2011,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":1,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":6,"fromRev":5,"mode":"upd","time":"Tue 11 Jan, 2011 5:37","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":0,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":0,"publishedby":0,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":1,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":5,"fromRev":"","mode":"new","time":"Tue 11 Jan, 2011 5:24","type":"document","contentType":"text\/html","pagetitle":"Zona Socios","longtitle":"","description":"","alias":"zona-socios","link_attributes":"","published":0,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"Bienvenido a la zona privada para socios.","richtext":1,"template":2,"menuindex":8,"searchable":1,"cacheable":1,"createdby":2,"createdon":2011,"editedby":"Jose","editedon":0,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":0,"publishedby":0,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":28},{"revision":4,"fromRev":2,"mode":"upd","time":"Tue 11 Jan, 2011 5:01","type":"document","contentType":"text\/html","pagetitle":"Socios","longtitle":"","description":"","alias":"socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"<p>Esta zona es de acceso exclusivo para socios. <\/p><br \/>\r\n<p>A\u00fan estamos trabajando en ella, disculpen las molestias.<\/p>","richtext":1,"template":2,"menuindex":7,"searchable":1,"cacheable":1,"createdby":2,"createdon":2010,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2010,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":11},{"revision":3,"fromRev":"","mode":"upd","time":"Tue 11 Jan, 2011 5:00","type":"document","contentType":"text\/html","pagetitle":"Carnaval 2011: Mar y Culturas","longtitle":"","description":"","alias":"carnaval-2011:-mar-y-culturas","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":5,"isfolder":0,"introtext":"Mar y Culturas ser\u00e1 el tema sobre el que girar\u00e1 la fiesta m\u00e1s importante de la capital grancanaria.","contentField":"<p>La pr\u00f3xima edici\u00f3n del Carnaval de Las Palmas de Gran Canaria ya tiene su alegor\u00eda. Mar y Culturas ser\u00e1 el tema sobre el que girar\u00e1 la fiesta m\u00e1s importante de la capital grancanaria y en la que buscar\u00e1n inspiraci\u00f3n los centenares de participantes en cualquiera de sus concursos y convocatorias p\u00fablicas. Mar y Culturas a\u00fana de esta manera los dos temas finalistas propuestos por los ciudadanos a trav\u00e9s de la consulta por internet -el mar y el imperio inca-, al tiempo que repercute en el mensaje permanente de la marca tur\u00edstica de nuestra ciudad: Las Palmas de Gran Canaria, ciudad de mar y culturas.\u00a0<\/p><br \/>\r\n<p>Murgas y comparsas, candidatas a Reina y aspirantes a Drag Queen, participantes de todas las edades en los concursos de disfraces, carrozas de la Gran Cabalgata, etc. as\u00ed como los miles de mascaritas que invaden las calles durante las noches de Carnaval cuentan desde hoy con su principal motivo de inspiraci\u00f3n.<\/p>","richtext":1,"template":2,"menuindex":0,"searchable":1,"cacheable":1,"createdby":1,"createdon":2010,"editedby":"Default Admin User","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2010,"publishedby":1,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":7},{"revision":2,"fromRev":1,"mode":"upd","time":"Tue 11 Jan, 2011 4:53","type":"document","contentType":"text\/html","pagetitle":"Socios","longtitle":"","description":"","alias":"socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"<p>Esta zona es de acceso exclusivo para socios. <\/p><br \/>\r\n<p>A\u00fan estamos trabajando en ella, disculpen las molestias.<\/p>","richtext":1,"template":2,"menuindex":7,"searchable":1,"cacheable":1,"createdby":2,"createdon":2010,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2010,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":11},{"revision":1,"fromRev":"","mode":"upd","time":"Tue 11 Jan, 2011 4:51","type":"document","contentType":"text\/html","pagetitle":"Socios","longtitle":"","description":"","alias":"socios","link_attributes":"","published":1,"pub_date":0,"unpub_date":0,"parent":0,"isfolder":0,"introtext":"","contentField":"<p>Esta zona es de acceso exclusivo para socios. <\/p><br \/>\r\n<p>A\u00fan estamos trabajando en ella, disculpen las molestias.<\/p>","richtext":1,"template":2,"menuindex":7,"searchable":1,"cacheable":1,"createdby":2,"createdon":2010,"editedby":"Jose","editedon":2011,"deleted":0,"deletedon":0,"deletedby":0,"publishedon":2010,"publishedby":2,"menutitle":"","donthit":0,"haskeywords":0,"hasmetatags":0,"privateweb":0,"privatemgr":0,"content_dispo":0,"hidemenu":0,"class":"modDocument","context_key":"web","content_type":1,"docid":11}]}
                    
                    
                    
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      That JSON response is actually from the getList processor (which is loaded when you open the tab).

                      When you right click a row in the grid, and press compare, only then it will request the compared info. So it should be a new request to the connector.


                      When you have the right ajax request, can you also paste the post values? Specifically "new" and "old"? "action" should be "compareResources".
                        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.

                      This discussion is closed to further replies. Keep calm and carry on.