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

    I wanted to establish a 'files browser directory' for the Editor role and so created a media source called 'Editor Filesystem' which references a assets/files directory. Everything seems to work ok, i can browse to the files via the RTE but a TV i set up for inputting images has lost the input option (see attached screen grab).
    Do i need to make any alterations to my TV settings for compatibility or is there something else i have missed?

    Thanks for any help

    J [ed. note: 9thwave last edited this post 14 years, 6 months ago.]
      www.9thwave.co.uk
         WEB | DESIGN | PRINT
      • 31946
      • 116 Posts
      Did you assign the Media Source to the Image-TV?
      Can you check the error log, there seems to be also a problem with phpthumb not rendering the thumbnail, maybe that can help us.
        • 36549
        • 572 Posts
        Hi,

        Thanks for replying.
        I didn't assign the Media Source to the TV no.
        In the TV's if i set the TV to be static and assign an image to the 'static file', then a thumbnail appears within the TV tab on the resource document, but i still can't upload an image.

        The error file is as folows:

        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1034) PHP warning: file_exists() [<a href='function.file-exists'>function.file-exists</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/~wwwtrent/connectors/system/images/image2.jpg) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1054) PHP warning: is_link() [<a href='function.is-link'>function.is-link</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1065) PHP warning: realpath() [<a href='function.realpath'>function.realpath</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize() [<a href='function.getimagesize'>function.getimagesize</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: Operation not permitted
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize() [<a href='function.getimagesize'>function.getimagesize</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 1312) PHP warning: getimagesize(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: Operation not permitted
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 3210) PHP warning: file_get_contents() [<a href='function.file-get-contents'>function.file-get-contents</a>]: open_basedir restriction in effect. File(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/bin/:/usr/local/bin/)
        [2012-01-23 20:10:21] (ERROR @ /home/wwwtrent/public_html/core/model/phpthumb/phpthumb.class.php : 3210) PHP warning: file_get_contents(/usr/local/apache/htdocs/home/wwwtrent/public_html/images/image2.jpg) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: Operation not permitted
        [2012-01-23 20:10:21] (ERROR @ /~wwwtrent/connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /home/wwwtrent/public_html/core/cache/phpthumb/phpThumb_cache_195.8.197.190_srcad8caf0740b88deb7c00bedb9935f73d_paradf896d45f319fa323d889e84ccb98c5_dat0.jpeg
        [2012-01-23 20:10:21] (ERROR @ /~wwwtrent/connectors/system/phpthumb.php) Error outputting thumbnail:
        OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557


        OK, when i remove the Admin Super User Group from the default Media Source of 'filesystems' permissions i then have the ability to upload the image TV's again.

        I have tried to create another Media Source for the Editor but when i assign the relevant editor user group i can no longer see the Media Source in the Manager...it is however displaying in the database table.

        i'm sure this should be easy and would love a step by step tutorial to create a file path for 'editors' as alas Media Sources are too new to be mentioned in the Modx book.

        Thanks for any help

        J
          www.9thwave.co.uk
             WEB | DESIGN | PRINT
          • 36549
          • 572 Posts
          UPDATE:

          Ok i've sorted it out but in a somehwat backwards manner.
          1. I created another Media Source called 'Editor filesystem' but instead of adding the editor to this i added the super admin and left the fields 'basePath' and 'baseUrl' blank.
          2. I then altered the default 'filesystem' to contain my files paths in 'basePath' and 'baseUrl':
          basePath - assets/files/
          baseUrl - assets/files/
          And 'Permissions' was left blank.
          3. I also had to change the 'ThumbnailType' to jpg for my TV's thumbnails to display.

          It all seems a little counter intuitive to me but it works so i'll just have to get my head around the logic.

          Thanks
            www.9thwave.co.uk
               WEB | DESIGN | PRINT
            • 36722
            • 101 Posts
            This works, but then doesn't that set your base file system for everything to there? Including the files tab in the manager?
              Shawn Himmelberger
              Himmelberger Design
              https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Design | https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Development
              • 36549
              • 572 Posts
              Hi,

              Yes it does but in the absence of a better solution this will suffice.
              If you or anyone know of another solution it would be great to hear it?
                www.9thwave.co.uk
                   WEB | DESIGN | PRINT
                • 36549
                • 572 Posts
                Further to the above...in the image TV under Media Sources, it is not obvious there is anything to click under the heading 'Source', but that is where you can choose your media source from a dropdown...phew glad that's sorted!
                [ed. note: 9thwave last edited this post 14 years, 6 months ago.]
                  www.9thwave.co.uk
                     WEB | DESIGN | PRINT
                  • 36722
                  • 101 Posts
                  I've been trying to spread the knowledge here, and everywhere. When using media sources and getResources you must use the processTV=`1` parameter.

                  That is all. Hope it helps.
                    Shawn Himmelberger
                    Himmelberger Design
                    https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Design | https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Development
                    • 36722
                    • 101 Posts
                    I've been trying to spread the knowledge here, and everywhere. When using media sources and getResources you must use the processTV=`1` parameter.

                    That is all. Hope it helps.
                      Shawn Himmelberger
                      Himmelberger Design
                      https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Design | https://himmdesign.com/services/website-development/modx"" target="_blank" rel="nofollow"> MODx Web Development
                      • 25839
                      • 23 Posts
                      no, it wont help, because problem exists in manager, where you dont use getResources

                      I mean, this is critical bug, it causes Internal Server Errors, blank screens and array of other bugs because phpthumb crashes both manager and website, there are multiple variations of the same bug in tracker hanging there for months.

                      for example - people are reporting 'endless save loop' bug, where in fact they are using imageTV, and phpthumb is trying to display thumbnail of this TV and cannot (because of broken media sources paths) and after several minutes crashes

                      revolution is so broken ;/ [ed. note: rygar last edited this post 14 years, 4 months ago.]