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
I think this is the same as: https://forum.grabaperch.com/forum/03-31-2017-image-problems-in-repeater-block
Hi, I think you have not closed the
<img>
tag properly.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.
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...
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:
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...
I'll see if I can reproduce it. Which browser are you using?
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.
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.
We're looking at this this week.
Same problem here.
Same problem here.
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?
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.