We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • I am trying to use the migxResourceMediaPath snippet to be the default media resource type for content fields on my website. However, I keep getting "docid could not be determined" in the error log and the snippet defaults to file where the resource specific files should be created, but are not. My snippet is below. Could anyone give me advice on getting this working?

    I tried setting &createfolder to true, but then all it did was send me to the root of the file system.

    [[migxResourceMediaPath? &pathTpl=`assets/content/{breadcrumb}`]]
      Ben Morrison
      Hacking templates to pieces since 2003
      • 30491
      • 44 Posts
      I'm experiencing the same error, oddly enough--I suspect it occurred after upgrading MIGX to the latest version...I haven't been able to determine what is causing this...

      the modx error log reads:

      (ERROR @ /assets/components/migx/connector.php) [migxResourceMediaPath]: docid could not be determined.


      My snippet code:
      [[!migxResourceMediaPath? &pathTpl=`assets/resImages/{id}/` ]]


      I followed this tutorial:
      http://rtfm.modx.com/extras/revo/migx/migx.tutorials/migx.use-resource-specific-media-source-and-multifile-uploader#MIGX.Useresource-specificmediasourceandmultifile-uploader-Useresourcespecificmediasourceandmultifileuploader

      Did you manage to fix it Ben?

      Thank you,
      T
        • 4172
        • 5,888 Posts
        just created a fresh modx-installation on modx-cloud and followed the tutorial to the word.
        Seems still to work.

        Only thing, I had to create the file-folder 'assets/resourceimages/'

          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 30491
          • 44 Posts
          Thanks alot Bruno - for me its not working on v.2.2.9 and 2.2.12 for some reason...the odd thing is...it works with the 'Upload Files' button (the ajax uploader) perfectly..I only encounter this issue when using the standard 'Add Image' button...

          very peculiar...for some reason the {id} directory is not being created, only after the 'Upload Files' (ajax uploader) creates the directory..only then can I use the 'Add Image' and have it work normally..presumably because the {id} directory was already created by the 'Upload Files' functionality...

          strange I don't know what is the matter, could it be a permissions issue? if so then why does the 'Upload Files' functionality work..
            • 4172
            • 5,888 Posts
            I see.

            You are right, the folder is only created with the multiuploader - script.
            But you can try using this snippet - tag inside the mediasource-path and url.
            [[migxResourceMediaPath? &pathTpl=`assets/resourceimages/{id}/` &createFolder=`1`]]


            Another way could be to add some code to a php-config-file, which is called everytime, before MIGX is running a processor.

              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 12410
              • 353 Posts
              I get
              /manager/index.php) [migxResourceMediaPath]: docid could not be determined
              . when trying to add a row. If I do add an item the template renders blank. Just started happening

              Here my basepath
              [[migxResourceMediaPath? &createFolder=`1` &pathTpl=`assets/resourceimages/resource{id}/`]]


              Revo 2.3.2, latest Migx, Centos 6, Apache 2 MySQL 5, PHP 5.4
                • 4172
                • 5,888 Posts
                in which situation exactly and what setup?
                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 38314
                  • 45 Posts
                  After searching for a while, I can find one explanation for this message :
                  (ERROR @ /home/mywebsite/public_html/core/cache/includes/elements/modsnippet/47.include.cache.php : 69) [migxResourceMediaPath]: docid could not be determined.


                  I've set up a Media Source called "thumbnails" with :
                  basePath ==> [[migxResourceMediaPath? &pathTpl=`assets/img/thumb/{id}/` &createFolder=`1`]]

                  So, when I browse the files tab in the left panel of the manager and I refresh the Media Source "thumbnails", then I have this message in the log. It's not surprising as there's not resources ID linked to the snippet because where in the backend.

                  There might be other cases like this one occurs in within the manager.

                  Maybe a clause in the snippet giving a default resource id would solve this, but not sure it's a good solution.
                    • 4172
                    • 5,888 Posts
                    you shouldn't allow to browse this mediasource outside the resource-context. Not sure, if there is a way with permissions or something out of the box, or without writing a plugin or something, though.
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 12410
                      • 353 Posts
                      Hi
                      When I try and open a resource in the manager I get a blank screen and this error in the error log... [2017-08-07 19:26:16] (ERROR @ /var/www/html/xyz.com/public_html/bhr/core/cache/includes/elements/modsnippet/94.include.cache.php : 69) [migxResourceMediaPath]: docid could not be determined.
                      Its happening after I migrated and updated to Revo 2.5.7. Im using latest Migx 2.11.0.
                      Any fix?
                      Thanks

                      Revo 257
                      PHP 7
                      Ubuntu 14
                      Apache 2
                      Mysql 5
                      [ed. note: howster last edited this post 6 years, 8 months ago.]