We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43371
    • 17 Posts
    I'm afraid I can't help, but I can at least confirm that I have exactly the same issue running Revo with IIS and SqlServer, so it's possibly SqlServer related. I've been maintaining an Evo' site for a while, but wanted to test Revo' with an eye on upgrading, so I've built a clean Revo/IIS/SqlServer install on Windows, and I see exactly the same problem with FURLS - they render as empty strings in the HTML, so it's nothing to do with the url rewriting (which works fine on Windows & IIS for my Evo' site).

    (As an aside, I see no database tables under System Information i.e. it's a blank grid - even though modx is clearly working in all other respects - so SqlServer integration appears to be slightly confused.)
      • 22303 MODX Staff
      • 10,725 Posts
      If someone with access to Windows licenses for the needed software to test/develop MODX on SQL Server would be willing to participate, I would certainly welcome the contributions. I lost my licenses for all the needed Microsoft software last year and all SQL Server development/testing has relied on feedback and contributions from the community ever since.
        • 43371
        • 17 Posts
        I think I have identified the bug causing FURLs to fail - and it is indeed to do with the alias_map.

        In modcontext.class.php, function getResourceURI (line 395 on my build), the first 'if' clause is 'if (isset($this->aliasMap))' - now unfortunately it is set, but it's set to an empty array. This happens in modcontext.class.php, function prepare (line 88 in my build). In that 'prepare' function, various fields are initialized, one of which is aliasMap - and it's initialized to an empty array, presumably because there are no 'aliases'.

        So, back in 'getResourceURI', if you change 'if (isset(...' to 'if (!empty(...', which also tests for an empty array, FURLs start working.

        I honestly don't know enough about how the context initialization code works to know if this is a safe thing to do, and presumably there are other tests elsewhere in the code that make the same assumptions about other fields initialized at the same time (I can see config, resourceMap, aliasMap, webLinkMap, eventMap, pluginCache all initialized in the same place) - if all these other tests also use 'isset' rather than '!empty' there will be other bugs.

        But the change above does get FURLs working!
          • 43371
          • 17 Posts
          Actually, while I was tracing through the code to find the above, I also noticed a bug in modparser.class.php in the 'process' function for modLinkTag - about 26 lines into the function (line 1249 on my build) there's a call
          $resource = $this->modx->findResource($context, $this->_output);
          
          The two parameters are in fact the wrong way round - $context should come second.

          This is code is traversed, but just happens to produce a 'working' result by chance.
            • 3749
            • 24,544 Posts
            Could you report those as separate bugs here: http://bugs.modx.com, so they won't be forgotten. Thanks. smiley

              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
              • 43371
              • 17 Posts
              OK, two bugs logged, 9847 for the main FURL problem, and 9846 for the incorrect call to findResource.
                • 3749
                • 24,544 Posts
                Thank you! smiley
                  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
                  • 22629
                  • 194 Posts
                  Thanks for this info and many thanks for digging into it.

                  Quote from: aclcarter at Apr 16, 2013, 11:42 AM
                  In modcontext.class.php, function getResourceURI (line 395 on my build), the first 'if' clause is 'if (isset($this->aliasMap))'

                  Can you elaborate on where this file is? In my install (Revo 2.2.6-pl), I can see modcontext.class.php in core/model/modx and core/model/modx/sqlsrv. Neither of these files has a line 395, nor a function called getResourceURI.

                  Thanks!
                  Andy
                    Andy Shellam | www.networkmail.eu | @Pandy06269 @NetworkMail

                    modx Revolution 2.2.6
                    Windows 2012 | IIS 8 | php 5.4.11 | MySQL 5.5.29

                    Content-Managed Websites Built on MODX
                    • 3749
                    • 24,544 Posts
                    I searched my entire MODX install for getResourceURI and came up empty. I wonder if it's part of an Extra I don't have.
                      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
                      • 43371
                      • 17 Posts
                      I don't know what to say!

                      First, it's not in the sqlsrv subclass of modContext, so you won't find it in the sqlsrv subdirectory. And because it's under the 'core' tree I have to assume it's not part of an extension. In my 2.2.7 installation, in directory core/model/modx there is a file called modcontext.class.php. I tried to attach the file here, but for some reason if I do it won't let me 'reply'.

                      Let me know if you still don't find it!

                      Cheers,

                      Andy