Forum

Thread tagged as: Problem, Configuration

Perch Blocks | Select or Upload an Image wont engage the asset library.

Hi, I have a Perch Block created for a Lightbox gallery. Basically the idea is to have 3 CSS div classes (square, landscape, portrait) which allows the user to upload images as CSS background images and gives options around different orientations. I think this part is working okay, but when I try to test on Perch (using Perch 3) the Select or Upload an Image button wont engage to open the assets library. Any ideas? I've got a similar lightbox to function before on Perch without issue, but this site is on Perch 3 and I'm curious has this been spotted before? Presumably there is something minor wrong with my code! :-/

<!--Gallery Block-->
<perch:block type="text3" label="Gallery Block"> 
     <div class="container-wide">
      <div class="gallery-wrapper">
        <div class="project-row w-row">
          <div class="col-1 gal-col-1 w-col w-col-3 w-col-medium-6 w-col-small-small-stack w-col-tiny-tiny-stack">

          <perch:repeater id="images" label="Gallery Images" max="5">
            <div class="practice-block">
              <a class="overlay-off w-inline-block w-lightbox <perch:content type="select" id="selector" label="Select Thumbnail Size" options="Square|square, Landscape|landscape, Portrait|portrait" /> " data-ix="scroll-in1" rel="group" href="<perch:content type="image" id="gallery" label="gallery"/>" style="background:url('<perch:content type="image" id="galleryImage" width="600" />');"><img class="image" sizes="100vw" src="<perch:content type="image" id="galleryImage" label="Image"/>

         <script class="w-json" type="application/json">
            { "group": "Gallery", "items": [{
              "type": "image",

              "url": "<perch:content type="image" id="galleryImage" width="1800"/>",
              "caption": "<perch:content type="text" id="caption" label="Image Caption"/>"
            }] }
          </script>

              </a>
              <div class="blue-line"></div>
                <perch:content type="textarea" html="true" editor="ckeditor" id="galleryfeatText" label="Feature Text" />
            </div>

          </div>

          </perch:repeater>
</perch:block>

Summary information

Perch: 3.0.1, PHP: 7.1.1, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO Server OS: Darwin, apache2handler Installed apps: content (3.0.1), assets (3.0.1), categories (3.0.1) App runtimes: <?php $apps_list = [ ]; PERCH_LOGINPATH: /mckevittarchitects/perch PERCH_PATH: /Applications/MAMP/htdocs/mckevittarchitects/perch PERCH_CORE: /Applications/MAMP/htdocs/mckevittarchitects/perch/core PERCH_RESFILEPATH: /Applications/MAMP/htdocs/mckevittarchitects/perch/resources Image manipulation: GD PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7 Resource folder writeable: Yes HTTP_HOST: localhost:8888 DOCUMENT_ROOT: /Applications/MAMP/htdocs REQUEST_URI: /mckevittarchitects/perch/core/settings/diagnostics/ SCRIPT_NAME: /mckevittarchitects/perch/core/settings/diagnostics/index.php

Cormac Kerrigan

Cormac Kerrigan [ 0 points ]

  • 2 weeks ago
Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

Hi, I think you have not closed the <img> tag properly.

<img class="image" sizes="100vw" src="<perch:content type="image" id="galleryImage" label="Image"/>  
...

Hi Drew, Yes I've just spotted another "hero-image" block that was functioning perfectly has broke (like above) when wrapped with a perch:repeater.

Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

Is that a new issue, or something relating to the above?

Based on your suggestion I thought they were related.... However with my first issue on the gallery block, I've removed the perch repeaters from this block and the issue is still occurring regardless...

Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

If it's the same as above then it's logged and we'll fix it.

Hi Drew. It seems like a very similar problem. i.e. images not working when using repeaters within blocks. However I'm not 100% certain that it is and for the moment should be treated as a separate issue. The issue happens for me irrespective if I'm using repeaters or not within blocks. I do not get an error as such but the assets window fails to open and the perch page crashes when I click the Select or Upload an Image link. I have enabled debug to try and get more info but it appears to be minimal:



Debug Message - Perch 3.0.1 [1] SELECT u.*, r.* FROM perch3_users u, perch3_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='04ee1174809a081c9b92a3e75bed8220' LIMIT 1 UPDATE perch3_users SET userHash='c3acbdb28e60a61ea501f3eaa511f21b' WHERE userID='1' [26] SELECT p.privKey FROM perch3_user_privileges p [11] SELECT settingID, settingValue, userID FROM perch3_settings WHERE userID=1 OR userID=0 ORDER BY userID ASC [6] SELECT itemValue FROM perch3_menu_items WHERE itemType='app' [1] SELECT * FROM perch3_content_regions WHERE regionID=6 LIMIT 1 [1] SELECT * FROM perch3_pages WHERE pageID='3' LIMIT 1 Using template: /templates/content/blocks.html [1] SELECT * FROM perch3_content_items c WHERE c.regionID=6 AND c.itemRev=27 ORDER BY c.itemOrder ASC Using template: /templates/content/blocks.html [1] SELECT * FROM perch3_content_items c WHERE c.regionID=6 AND c.itemRev=27 ORDER BY c.itemOrder ASC Using template: /templates/content/blocks.html Form not posted or did not validate [1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 0, 1 [1] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=1 ORDER BY mi.itemOrder ASC [1] SELECT itemTitle FROM perch3_menu_items WHERE itemType='app' AND itemValue='content' LIMIT 1 [1] SELECT * FROM perch3_menu_items WHERE itemActive=1 AND itemType='menu' AND parentID=0 ORDER BY itemOrder ASC LIMIT 1, 10 [2] SELECT mi.*, p.privKey FROM perch3_menu_items mi LEFT JOIN perch3_user_privileges p ON mi.privID=p.privID WHERE mi.itemActive=1 AND mi.parentID=2 ORDER BY mi.itemOrder ASC File: /core/apps/content/modes/edit.form.post.php [1] SELECT * FROM perch3_resources WHERE resourceID='32' LIMIT 1 Array ( [assetID] => 32 [title] => Group cropped2 [_default] => /mckevittarchitects/perch/resources/group-cropped2.jpg [bucket] => default [path] => group-cropped2.jpg [size] => 400266 [w] => 1333 [h] => 1117 [mime] => image/jpeg [sizes] => Array ( [thumb] => Array ( [w] => 150 [h] => 125 [target_w] => 150 [target_h] => 150 [density] => 2 [path] => group-cropped2-thumb@2x.jpg [size] => 38771 [mime] => image/jpeg [assetID] => 33 ) ) ) [1] SELECT * FROM perch3_resources WHERE resourceID='34' LIMIT 1 Array ( [assetID] => 34 [title] => Old photo [_default] => /mckevittarchitects/perch/resources/old-photo.jpg [bucket] => default [path] => old-photo.jpg [size] => 71131 [w] => 420 [h] => 275 [mime] => image/jpeg [sizes] => Array ( [thumb] => Array ( [w] => 150 [h] => 98 [target_w] => 150 [target_h] => 150 [density] => 2 [path] => old-photo-thumb@2x.jpg [size] => 24679 [mime] => image/jpeg [assetID] => 35 ) ) ) [1] SELECT * FROM perch3_resources WHERE resourceID='38' LIMIT 1 Array ( [assetID] => 38 [title] => 03 Pair 02 [_default] => /mckevittarchitects/perch/resources/03-pair-02.jpg [bucket] => default [path] => 03-pair-02.jpg [size] => 767805 [w] => 2000 [h] => 1333 [mime] => image/jpeg [sizes] => Array ( [thumb] => Array ( [w] => 150 [h] => 99 [target_w] => 150 [target_h] => 150 [density] => 2 [path] => 03-pair-02-thumb@2x.jpg [size] => 24343 [mime] => image/jpeg [assetID] => 39 ) ) )
Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

What do you mean by "crashes"?

Hi Drew, So I've narrowed this issue even further. Basically, I have reduced back to just one test block in use (Full Width Hero Block below) When I add the below block to a blank page it works fine. i.e. it allows me to upload an image, save and update corresponding page. However.... when I then add the very same block underneath this saved block the original issue occurs again. i.e. Select or Upload an Image wont engage the asset library and the page crashes. When I say crashes, I mean it prevents me from scrolling down to the debug window and the page needs to be refreshed in order to do so. So basically, it allowing me to save and use the simple block below, but if I try to re-add it again the issue occurs. Hope this explains the issue better...

 <perch:blocks>

     <!--blocks hero image-->
    <perch:block type="image" label="Full Width Hero Block">


            <div class="container-wide">
                  <div class="hero-wrapper"><img class="project-hero" src="<perch:content type="image" id="heroImage1" help="ratio should be 16:9" />">
                  </div>
            </div>

    </perch:block>

 </perch:blocks>
Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

I'll see if I can reproduce it. Which browser are you using?

Paul O'Rely

Paul O'Rely [ 0 points ]

I'm experiencing the same issue with Perch 3.0.1. When I click the "Select or upload an image" or "Select or upload a file" links when they're inside a block, the assets overlay "flashes" (it shows up for a fraction of second and closes) and it locks the page scroll (by not removing "dialog-open" class from the body tag). It happens in both Chrome (57) and Firefox (52) for Mac.

Exactly as Paul has described above is happening to me. I have tried on Safari 10 & Chrome 57... both unsuccessful. For now the only way I can test a block is working okay is have it as the first in the page. Any blocks that are placed underneath the first block experience this issue.

Rachel Andrew

Rachel Andrew [ 353 points ]
Perch Support

Anyone with what appears to be the same problem should start a new thread with their diagnostics report etc. We can't help 2 people in one thread without getting very confused and fairly frequently what looks like the same problem isn't, thus adding to the confusion :)

Hi Drew/Rachel. Is there any update on this issue? Thanks.

Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

We're looking at this this week.

Same problem here.

Brad Hardinge

Brad Hardinge [ 0 points ]

Same problem here.

Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

This is fixed, so will be in 3.0.2 tomorrow.

Hi Drew is the update available yet? When I follow the steps and download from the licences page its still downloading v3.0.1. Thanks. Also, Could you confirm if Perch 3 will work on PHP 5.5 or is PHP 7 the bear minimum?

Drew McLellan

Drew McLellan [ 2176 points ]
Perch Support

Yes, available since around lunch time. Where are you downloading from? It should all be 3.0.2 everywhere.

PHP 5.4 is the minimum.