We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3632
    • 22 Posts
    Running a newly installed instance of Modx 2.1.3-pl in a subfolder we’ll call ’subf’ off of the server document root. Everything is working correctly including phpthumbof calls on the front end of the site. However, in manager, all thumbnails are broken including those displayed for image tvs though I can see from the phpthumb cache directory that the thumbnails are being created successfully. There are no errors showing in the ModX or Apache logs.

    From other posts here I have seen that not setting the PHPThumb document root can cause problems so I have set that to my document root and appended ’subf’. I have also set the configuration to allow image sources from above the document root to true which was also suggested as a fix.

    The broken thumbnails have their src set to URL’s like:

    http://myserver/subf/connectors/system/phpthumb.php?h=150&w=150&src=assets/templates/main/images/content-images/myimage.jpg&basePath=&basePathRelative=1&baseUrl=&baseUrlRelative=1&baseUrlPrependCheckSlash=1

    and I believe this should be correct - however when I call such URL’s directly in the browser I get nothing.

    In my .htaccess file I am setting the rewritebase to /subf/ though it makes no difference even if I leave it at the default value of /.

    I can access the thumbnailed image from cache if I call it directly in the browser and I have established that everyone has read access on the image there.

    I am totally out of ideas on how to tackle resolving this so would be grateful for any ideas or input.

    The difficulty with the thumbnails seems to be the output stage but I can not figure out how to access the debug messages in PHPThumb.
      • 28215
      • 4,149 Posts
      Whats your filemanager_* settings set to?
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 3632
        • 22 Posts
        Hey Shaun,

        filemanager_path and filemanager_url are blank but filemanager is working and I can even see image popups.
          • 28215
          • 4,149 Posts
          So the only problem is image thumbnails in the MODx.Browser?

          Are there any other parts not working? (ie, after you select an image in an image tv, does it load the image properly? Do images from TVs render on frontend?)

          Also, don’t paste it here, but in the img src you pasted earlier...are there any HTTP_MODAUTH params sent?

            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 3632
            • 22 Posts
            Additionally, if I update filemanager path to /document_root/subf/ and filemanager_url to /subf/ I get a broken file manager with the message
            /document_root/subf//document_root/subf/ is not a valid directory.
              • 3632
              • 22 Posts
              So the only problem is image thumbnails in the MODx.Browser?

              Yes. Everything else is working fine.

              Are there any other parts not working? (ie, after you select an image in an image tv, does it load the image properly? Do images from TVs render on frontend?)

              Yhe TV preview on the backend renders a broken image, on the front end it is fine.

              Also, don’t paste it here, but in the img src you pasted earlier...are there any HTTP_MODAUTH params sent?

              No, no HTTP_MODAUTH params - URL’s appear as posted above.

                • 28215
                • 4,149 Posts
                Are you talking about the thumbnail grid in MODx.Browser (the popup window that you browse to select), or the TV image preview that shows images below a TV input?
                  shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                  • 3632
                  • 22 Posts
                  On the left hand side where the site tree is displayed, if I click on files I see all files and folders from my subf folder listed. If I go into a folder there and hover my mouse over images (even in the cache folder) I see the image displayed in the popup.

                  In a resource update or addition form, when I have an image tv, below the button that allows me to select the image to associate with that TV there is a preview but all I see is a broken image. The URL pattern of the image I see there is in the first post.

                  e.g. http://myserver/subf/connectors/system/phpthumb.php?h=150&w=150&src=assets/templates/main/images/content-images/myimage.jpg&basePath=&basePathRelative=1&baseUrl=&baseUrlRelative=1&baseUrlPrependCheckSlash=1

                  Images do work in the Tinymce editor frame but when I am browsing to select an image I see broken images where the thumbnail previews should be.

                  I have even tried running setup again based on a newly uploaded fresh copy of modx and still no joy. Is there any way to access the debug messages in phpthumb? Nothing appears in the modx error log.
                    • 3632
                    • 22 Posts
                    OK, day 2 on this and I finally have progress to report. Since the images were appearing in the cache folder I figured it must be an output problem so began to go through the processor for phpthumb and sure enough, the issue was with the output method of the modphpthumb class.

                    Digging deeper I tracked down the problem to the headers_sent check on line 156 of the modphpthumb class file though I could take that investigation no further as including the optional arguments for file name and line number to retrieve where the output is considered to have started returned an empty string and 0 respectively.

                    Perhaps this might make more sense to you Shaun than it did to me - anyway, preventing the header check I now have working thumbnails again.
                    • Tried enabling the phpthumb_allow_src_above_docroot system setting?
                        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.