We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3866 ☆ A M B ☆
    • 350 Posts
    Quote from: boomerang at Jul 17, 2013, 02:25 AM

    [2013-07-17 02:18:56] (ERROR @ /connectors/system/phpthumb.php) phpThumb was unable to generate a thumbnail for: /paas/c0000/www/core/cache/phpthumb/phpThumb_cache_mysite.modxcloud.com_src4d4abfee0e241d9af8bbf9c2cb30ef7e_parfe75230c38c1dd77cfb659e43ae25583_dat0.jpeg
    [2013-07-17 02:18:56] (ERROR @ /connectors/system/phpthumb.php) Error outputting thumbnail:
    OutputThumbnail() failed because !is_resource($this->gdimg_output) in file "phpthumb.class.php" on line 557



    Managed to clear the error by ensuring the grid was pointing to the correct mediasource.

    Unfortunately that doesn't clear the fact that I'm unable to upload images into more than one folder relating to ID without clearing the cache and refreshing the screen. Think this is the last hurdle for what I want to achieve.
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 17249 ☆ A M B ☆
      • 165 Posts
      I'm using a separate table/Object to save the images data and had never any issue like this.
      Perhaps it has something to do with being MIGx instead of MIGxDB
        • 3866 ☆ A M B ☆
        • 350 Posts
        Quote from: lithiumlab at Jul 23, 2013, 09:38 AM
        I'm using a separate table/Object to save the images data and had never any issue like this.
        Perhaps it has something to do with being MIGx instead of MIGxDB

        Do you have more than one image in one table linked to the ID in another table - if that makes sense?
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel
          • 17249 ☆ A M B ☆
          • 165 Posts
          Yes, check the first post of this thread
            • 3866 ☆ A M B ☆
            • 350 Posts
            Hi lithiumlab, I'm not entirely sure how you've created the "gallery" but it really isn't something I need. All I want to do is to add the link to the images using multifile upload via an MIGX TV which loads into the relevant files. It does work other than the fact I can seem to go from one entry to another with images being uploaded to the correct folder.

            But thanks for your input.
              Helen Warner
              Number one pixel!
              Proud to be linked with MODX at Crimson Pixel
              • 3866 ☆ A M B ☆
              • 350 Posts
              Quote from: Bruno17 at Apr 30, 2013, 09:10 AM


              4. Create a copy of the migx/processors/mgr/default/fields.php
              to
              cms/processors/mgr/default/fields.php

              and change this line:
              $_SESSION;['migxWorkingObjectid']; = $object_id;
              

              to:
              $_SESSION;['migxWorkingObjectid']; = $modx--->getOption('co_id',$_REQUEST,'undefined');
              

              This does update the SESSION-var every time you open the update-window. This way the mediasource-snippet can get the object-id of the currently edited object and the filebrowser can navigate to the correct filepath.

              OK, this seems to be an issue for the way I'm implementing the multifile upload as soon as I implement this I can no longer access my images using the multifile upload.
                Helen Warner
                Number one pixel!
                Proud to be linked with MODX at Crimson Pixel
                • 17249 ☆ A M B ☆
                • 165 Posts
                You probably will not need to update nothing because the last version of MIGx has all this updates in place already.
                I suggest you to uninstall all migx packages, install the last one and test again. Maybe a fresh install on the cloud can help.
                Try to isolate the problem, so its easier to ask Bruno for some hints. Maybe a small case scenario like https://github.com/Bruno17/migxcart
                (Remember to use Create Tables from schema)
                  • 3866 ☆ A M B ☆
                  • 350 Posts
                  Ok, as per your suggestion, I've worked through the migxcart (using latest github MIGX 2.5.4) and whilst images are now uploading into correct folders they are not rendering in the grid for the image table. See attached.

                  In the filename config there is a need for chunk and I'm using this.renderChunk with the following:

                  <img src="[[getmigxcartfilepath:phpthumbof=`w=150`? &filename=`[[+filename]]`]]"/>  


                  And snippet with path amended to where the filenames are :

                  <?php
                  $modx->resource=$modx->newObject('modResource');
                  
                  $filename = $modx->getOption('filename',$scriptProperties);
                  $object_id = $modx->getOption('object_id',$_REQUEST);
                  
                  return 'assets/migxcartimages/' . $object_id . '/' . $filename;


                  But no images appear in the grid and nothing is added to the image table.

                  If I add something manually which is using only two fields it does create an entry in the database so I know information is being added, but not the filepath.

                  UPDATE: The chunk does appear to be rendered, as I can add additional text and this appears in the grid but it is not actually added to the table in the database, it seems the information from the MIGXdb isn't getting to the table although the field names seem correct. [ed. note: boomerang last edited this post 13 years, 2 months ago.]
                    Helen Warner
                    Number one pixel!
                    Proud to be linked with MODX at Crimson Pixel
                    • 17249 ☆ A M B ☆
                    • 165 Posts
                    Thats the point of using mediasources.
                    You're not adding the path in the database, only the filename.
                    This is convenient in most cases. Think about when migrating from development to production, or using this component in another website.
                    paths are not going to be same, so its convenient to not save it in the database.
                    So, you create a media source pointing to your correct path in each different environment.

                    Check the following:

                    put only this in your renderImageColumn chunk:
                    filename: [[+filename]] <br />
                    path: [[getmigxcartfilepath:phpthumbof=`w=150`? &filename=`[[+filename]]`]]
                    


                    and paste the output when you go to images grid here to see what is coming out


                    Have you set up your mediasource and associated it with your migxcartimage Tv
                    take a look at the mine in the attached .png

                    Are you sure there's a core/components/migxcart/migxconfigs/migxcartimages.config.inc.php with the correct values?
                    make sure there's a Resource with ID you put there and a TVname that actually exists.


                    <?php
                     
                    if (isset($_REQUEST['iframeTpl']) && $_REQUEST['iframeTpl']=='ajaxupload.html'){
                        $_REQUEST['resource_id'] = '1';// we need any resource-id of a resource in the correct context, just to get the context
                        $_REQUEST['tv_name'] = 'migxcartimage';// we need a image-tv with the correct mediasource in this context    
                    }
                    


                    If you have all this in place you should not be having any issues. [ed. note: lithiumlab last edited this post 13 years, 2 months ago.]
                      • 3866 ☆ A M B ☆
                      • 350 Posts
                      This is such a learning curve wink, I do appreciate your help. So on to your comments.

                      I do have correct TV with correct mediasource although I did had an error with migxcartonupload being input as [[migxcartonupload]], however, as per your suggestion re the chunk it appears I'm not getting the filename, see attached.

                      This is the snippet being used:

                      $modx->resource=$modx->newObject('modResource');
                      
                      $filename = $modx->getOption('filename',$scriptProperties);
                      $object_id = $modx->getOption('object_id',$_REQUEST);
                      
                      return 'assets/migxcartimages/' . $object_id . '/' . $filename;


                      Also are the files supposed to appear when you hit the Refresh button?

                      Also can confirm TV and mediasource are correct as per config file:

                      Are you sure there's a core/components/migxcart/migxconfigs/migxcartimages.config.inc.php with the correct values?
                      make sure there's a Resource with ID you put there and a TVname that actually exists.

                      PS I added the text "file name no here"
                        Helen Warner
                        Number one pixel!
                        Proud to be linked with MODX at Crimson Pixel