Forum

Thread tagged as: Problem, Error, Runway

Assets being duplicated

Hello,

I'm having a strange issue where assets added to a certain bucket are doubling up in the thumbnail view. There isn't two files being uploaded to the server, or two records in the database just two copies of the same thumbnail that link to the same asset page. Can't figure out why this is happening. Any ideas?

Diagnostics:

Perch Runway: 2.8.26, PHP: 5.6.18, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.26), assets (2.8.26), categories (2.8.26), perch_members (1.4.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_members' );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/mysite/public_html/media/perch
PERCH_CORE: /home/mysite/public_html/media/perch/core
PERCH_RESFILEPATH: /home/mysite/public_html/media/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 1024M, Max POST 1024M, Memory: 256M, Total max file upload: 256M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/mysite/public_html/media
HTTP_HOST: media.mysite.com
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Mark Greenwood

Mark Greenwood 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's not something we've seen. How are they being added? When do they double up?

Hi Drew,

I've tried both drag and drop and clicking the area to bring up the file dialog box. It's happening on both Mac and Windows with Chrome and Firefox so we are pretty sure it's not a client-side issue. It could be an edge case in my template though?

In my template I have an image upload to the default bucket and then a repeater further down which contains a file upload to a bucket called 'downloads'. We've had all kinds of files uploaded to this field but the ones that are doubling up are jpg/png images. We didn't realise it was only images that were doubling until after starting this thread. So it could simply be image uploads to the file field type? It is only these images that are doubling up and it happens when the user clicks 'save' on the collection item.

If we just upload the assets, you only see one of each until saving the item.

If required, here is my template.

<div class="containment">
    <div class="item-block row">
        <perch:if exists="thumbnail">
        <div class="item-image">
            <perch:content id="thumbnail" type="image" label="Preview Image" width="500" height="375" crop="true" help="Image will be resized/cropped to 500x375px. Not an image users can download directly. See below." order="4" suppress="true" />
            <img src="<perch:content id="thumbnail" type="image" width="400" height="300" crop="true" />"
                  alt="<perch:content id="title" type="text" label="Title" title="true" order="1" />"
                  sizes="(min-width:1200px) 500px,
                         (min-width:992px) 420px,
                         (min-width:768px) 312px,
                         (min-width:532px)  500px,
                         100vw"
                  srcset="<perch:content id="thumbnail" type="image" width="400" height="300" crop="true" /> 400w,
                          <perch:content id="thumbnail" type="image" width="500" height="375" crop="true" /> 500w,
                          <perch:content id="thumbnail" type="image" width="400" height="300" crop="true" density="2" /> 800w,
                          <perch:content id="thumbnail" type="image" width="500" height="375" crop="true" density="2" /> 1000w" />
        </div>
        </perch:if>
        <div class="item-details">
            <h1><perch:content id="title" type="text" /></h1>
            <perch:content id="description" type="textarea" label="Description" help="Describe the image to make it easy for distributors to find it." markdown="true" order="2" />
            <perch:repeater id="downloads" label="Downloads" order="5" divider-before="Downloads" notes-before="IMPORTANT: Please remove any special characters from file names before uploading.">
                <perch:before><h2>Downloads</h2>
                <ul class="item-downloads"></perch:before>
                <li class="item-download">
                    <a href="<perch:content id="file" type="file" label="File" bucket="downloads" help="Please be patient, uploading large files may take some time." />" download><perch:content id="info" type="text" label="File Info" help="A tiny note to put next to the download, like width, height, resolution, print or web, etc" /></a>
                </li>
                <perch:after></ul></perch:after>
            </perch:repeater>
            <hr>
            <div class="item-meta"><span class="label">Item ID:</span> <perch:content id="_id" type="hidden" /></div>
            <div class="item-meta"><span class="label">Date uploaded:</span> <perch:content id="upload_date" type="date" label="Date Uploaded" format="F d, Y" order="3" /></div>
        </div>
    </div>
</div>

Hope that helps or at least makes sense!?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using Paranoid Security Mode?

No, I've not had chance to check that out yet.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll need to investigate and see what I can come up with.

No problem! As said it's not duping the files or database records, it's just odd.

Thank you!

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ah, that's interesting - there's no duplication in the db?

Just double checked and no, no duplication in the db. It's an odd one for sure.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Gotta be the query then - thanks, we'll take a look.

Thanks Drew!