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

    got a problem with gallery TVs. The thumbnails previews don’t show up.

    I have the latest modx revo 2.0.8. All plugins (gallery, phpthumbof are also brand new).

    As far as I understand, the whole problem comes down to the fact, that the src parameter is wrong.

    This is the img link generated inside the tv:
    http://www.example.com/assets/components/gallery/connector.php?action=web/phpthumb&src=http://www.example.com/assets/components/gallery/files/2010/12/das-experiment_detail03.jpg&h=116&w=128&zc=0&far=C&fltr[]=rot|0&
    


    If I remove "http://www.example.com/ from src=
    http://www.example.com/assets/components/gallery/connector.php?action=web/phpthumb&src=assets/components/gallery/files/2010/12/das-experiment_detail03.jpg&h=116&w=128&zc=0&far=C&fltr[]=rot|0&
    


    Everything seems to be fine.

    Question: Is there a switch to accomplish this?

    Regards,

    pepebe

    P.S. gallery.thumbs_prepend_site_url = "no" doesn’t seem to work here.
      Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
      • 23018
      • 353 Posts
      OK, for now I have found an extremely crude and ugly solution that seems to work for me. If you have the same problem, you might consider this workaround to be a temporary fix.

      Basically, I believe the problem to be inside /assets/components/gallery/js/mgr/tv/galtv.js.

      On line 27 they insert {gal_src} into the image code, which is defined as data[’gal_src’] = data.absoluteImage on line 542. From my point of view it should rather be something like data[’gal_src’] = data.relativeImage or much better check if we want to have that relative or absolute paths.

      As far as I understand the "gallery.thumbs_prepend_site_url" gallery system setting is responsible for that. Unfortunately there is a bug in modx that sets the value of this parameter to "empty" instead of "zero" or "false" (http://bugs.modx.com/issues/3716). I can’t prove it, but I have the feeling that this is where gallery is getting it all wrong.

      Here comes my fix:

      Open /core/components/gallery/model/gallery/galitem.class.php and have a look at line 50-53.

                  case 'absoluteImage':
                      $value = $this->getSiteUrl().$this->xpdo->getOption('gallery.files_url').$this->get('filename');
                      break;
      

      .
      Change those lines to
                  case 'absoluteImage':        
                      if ( $this->xpdo->getOption('gallery.thumbs_prepend_site_url') !== 1 ) {
                          $value = $this->xpdo->getOption('gallery.files_url').$this->get('filename');
                      } else {
                          $value = $this->getSiteUrl().$this->xpdo->getOption('gallery.files_url').$this->get('filename');                            
                      }
                      break;
      


      This is stupid for several reasons, but it works for now.

      Hope that this helps until someone comes up with a better solution.

      Regards,

      pepebe
        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
        • 28215
        • 4,149 Posts
        Hi pepebe, can you post that in the Gallery issue tracker?

        https://github.com/splittingred/Gallery/issues/

        Thanks!
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 23018
          • 353 Posts
          I wanted to get some feedback before I cry wolf, but sure!

          BTW, I have VERY different behaviour with the crop function in FF, Opera and Chrome (latest, Ubuntu 10.04). Best thing is to prepare some screencast to show what I mean. Before I do that though, I’d like to know if anyone else is experiencing problem with cropping functionality.

          Regards,

          pepebe
            Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
            • 23018
            • 353 Posts
            @splittingred

            Thanks for your fast update to the code. I’m very busy working on a gallery project and appreciate your commitment.

            Kind reagards,

            pepebe

            P.S. For my current project, I made some modifications to gallery. I’ll post them here at the gallery forum. Hope some of them might be useful for other people or even become part of the core.
              Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
              • 16337
              • 44 Posts
              i would be interested in seeing this too.
                • 23018
                • 353 Posts
                Quote from: krisj at Mar 31, 2011, 12:07 PM

                i would be interested in seeing this too.

                Im in the midst of it. Nothing to show off right now. If I don’t post anything until the end of the second week of april, feel free to PM me. I have a bad habbit of getting lost in mey work.

                Regards,

                pepebe
                  Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe