We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38739
    • 4 Posts
    Hi Bruno,
    (Solved)
    I have a problem like already discussed. I have error/warning messages while uploading images and while doing import/export of MIGX options. I'll describe what I did in details now. Version numbers are modx-2-2-8 and MIGX-2.5.2.

    My goal is to install an image gallery using MIGX as described in http://rtfm.modx.com/display/ADDON/MIGX.Use+resource-specific+media+source+and+multifile-uploader . At first I created a simple test TV-parameter as described in http://rtfm.modx.com/display/ADDON/MIGX.Backend-Usage and it worked without any problems or warnings. I could input images and output the images in webpages without any error messages.

    Then I tried to use "dynamic resource-specific media source" because it allows to upload several images at once. I did everything as described in the manual step by step.

    1)I created the dynamic resource-specific media source - ok
    2)Then I created and tuned the MIGX - TV parameter - ok
    3)Then I created the Configuration for the MIGX-TV? steps 1-4 - ok. While choosing "Export/Import" on step 5 I received multiple warning messages
    Warning: Invalid argument supplied for foreach() in .... /core/components/migx/model/migx/migx.class.php on line 1746:


    As far as I can understand the number of messages equals to the number of json-nodes in the window. In spite of the messages the json model was created successfully.
    4) Then I bound a template to the TV parameter and got it on resource page -ok
    5) I tried to upload a series on images. After pressing the button "Upload files" under the "resourcealbum" TV-parameter I got the following:

    You can see 2 kinds of messages: a warning in the upper part of the screen (appeared at once after I pressed the button)
    Missing argument 2 for Migx:renderChunk(), called in /.../core/components/migx/processors/mgr/default/migxiframe.php on line 13 and defined in /.../core/components/migx/model/migx/migx.class.php on line 938
    and error message "increase post_max_size..." which appeared after I chose the image and pressed Upload. The file could *not* been uploaded. The parameters "post_max_size" and "upload_max_size" in the php.ini are equal to 32M, so the error message seems to be not adequate. I tried to make "setup" of MIGX parameter as described in the manual http://rtfm.modx.com/display/ADDON/MIGXdb.Configuration , tried several times to reinstall MIGX module, including dropping its tables clearing modx cache etc etc, nothing helped.

    Then in despair smiley I made a mirror installation (a total copy) of my website on another hosting. I copied all the files from htdocs dir and transfered all the mysql modx database having edited only host-specific parameters , i.e. logins, passwords,paths. (The php version on the first hosting is php5.4 while on the second it is php5.2). The mirror gave *no* errors or warnings and *everything* went smoothly without problems! So, I deduced that the problem is not associated with MIGX/MODX tuning but rather with environment (Apache,php).

    Oh! While I wrote this message the IT-support installed Imagick, Ioncube, apc, exif, cconv, ftp and ctype and the error messages disappeared. Cannot tell exactly which of installed modules helped but it works now! smiley Maybe my post will help somebody... [ed. note: adrachev last edited this post 13 years, 2 months ago.]
      • 38739
      • 4 Posts
      Hi,

      I think I found a bug in the MIGX component.
      When I use MIGX component to make a "resource-specific media source and
      multifile-uploader" (http://rtfm.modx.com/display/ADDON/MIGX.Use+resource-specific+media+source+and+multifile-uploader) and output the result webpage using getResources (as described in http://rtfm.modx.com/display/ADDON/MIGX.Frontend-Usage , chapter "Using MIGX with getResources") I get incorrect [[+image]] substitution.

      For example, I have 3 resources having id=3, 4 and 5. Each of them should have one or more images. After uploading the images the image files appear in the file structure as
      /assets/resourceimages/<resourceid>/<filename-from-the-resource-gallery>.jpg
      . When I call getImageList from the resource containing the images everything goes ok, i.e. the path to the images is correct. But if I call getImageList via getResources tpl the I get image paths like that:

      /assets/resourceimages/<one-and-the-same-id>/<filename-from-the-resource-gallery>.jpg
      .

      You can see that there should be different <resourceIds> and I get <one and the same id>. That is the bug.

      I make a sample modx installation specially to test this bug with a few simplest resources.
      Here is the getResource call I used:
      <p>3 migx galleries collected by getResources sordet by id in ASC order</p>
      [[!getResources?
      &parents=`2`
      &tpl=`myitemtpl`
      &sortby=`{"id":"ASC"}`
      ]]
      <p>Only one migx gallery (docid=4)</p>
      [[!getImageList? 
                  &tvname=`resourcealbum`
                  &docid=`4`
                  &tpl=`@CODE:[[+idx]] [[+image]]
       `]]
      

      Here is the getResource chunk:
      <ul>
          <li>[[+pagetitle]]; resource id=[[+id]]<br/>
                [[!getImageList? 
                  &tvname=`resourcealbum`
                  &docid=`[[+id]]`
                  &tpl=`@CODE:[[+idx]] [[+image]]<br/>
        `]]
          </li>
      </ul>
      

      And here is what I got in output:
      3 migx galleries collected by getResources sordet by id in ASC order
      
          Resource-3; resource id=3
          1 /assets/resourceimages/3/246.jpg
          1 /assets/resourceimages/3/252.jpg
      
          Resource-4; resource id=4
          2 /assets/resourceimages/3/247.jpg
      
          Resource-5; resource id=5
          3 /assets/resourceimages/3/248.jpg
      
      Only one migx gallery (docid=4)
      1 /assets/resourceimages/3/247.jpg 
      


      Please notice that in every line contaning image path we get one and the same /3/ subdirectory instead of /3/ for id=3, /4/ for id=4 and /5/ for id=5.

      Just for curiosity I tried {"id":"DESC"} order and got /5/ in all cases:
      3 migx galleries collected by getResources sordet by id in DESC order
      
          Resource-5; resource id=5
          1 /assets/resourceimages/5/248.jpg
      
          Resource-4; resource id=4
          2 /assets/resourceimages/5/247.jpg
      
          Resource-3; resource id=3
          3 /assets/resourceimages/5/246.jpg
          3 /assets/resourceimages/5/252.jpg
      
      Only one migx gallery (docid=4)
      1 /assets/resourceimages/5/247.jpg 
      


      So, as one can see the subdirectory does not change when getResources goes from one resource to the other. The image files in the subdirectory are ok, i.e. they correspond to the correct resource. The bug affects only the subdir names.

      Please show me my mistake if I am wrong smiley [ed. note: adrachev last edited this post 13 years, 2 months ago.]
        • 4172
        • 5,888 Posts
        try:
        <ul>
            <li>[[+pagetitle]]; resource id=[[+id]]<br/>
                  [[!getImageList?
                    &tvname=`resourcealbum`
                    &docid=`[[+id]]`
                    &processTVs=`0`
                    &tpl=`@CODE:[[+idx]] /assets/resourceimages/[[+property.docid]]/[[+image]]<br/>
          `]]
            </li>
        </ul>


        or

        <ul>
            <li>[[+pagetitle]]; resource id=[[+id]]<br/>
                  [[!getImageList?
                    &value=`[[+resourcealbum]]`
                    &docid=`[[+id]]`
                    &tpl=`@CODE:[[+idx]] /assets/resourceimages/[[+property.docid]]/[[+image]]<br/>
                  `]]
            </li>
        </ul>

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

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 38739
          • 4 Posts
          Hi Bruno,
          Thank you for quick reply!
          I tried the two variants, the first worked ok, the second didn't (getImageList gave empty output). Now, it seems that the problem as it is formulated in my previous post is solved, thanks!
          Now I try to go a little further. I want to use phpthumbof to format the pictures (width/height etc.). So I placed the tpl code into a separate chunk, formed the <img> tag (it showed pictures ok) and then I stopped thinking over how to add a phpthumbof call to it. The img src parameter is not a single placeholder ([[+image]]) but it is constructed of several parts now. So, I think that is why phpthumbof can't work. I tried:
          [[+idx]] <img src="/assets/resourceimages/[[+property.docid]]/[[+image:phpthumbof=`w=120&h=120`]]"><br/>

          along with &processTVs=`0` and other combinations but without success. I think that I will wait for the next version that solves this problem.
            • 4172
            • 5,888 Posts
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 38739
              • 4 Posts
              Quote from: Bruno17 at Aug 06, 2013, 01:47 PM
              https://forums.modx.com/thread/84547/migxresourcemediapath-for-other-tv-039-s#dis-post-466582
              Hi Bruno,
              Great, it works! Thank you very much!