Forum

Thread tagged as: Problem

Images and files in blocks disappearing on second save if disable asset manager

I'm using Blocks in Perch 3. In my template, I have a block for an image, and a block for a file. If I disable the asset manager, images and files will save when first loaded and appear in the front-end and back-end. But if I save the region for a second time, the image and file links disappear.

The <img ... > tag is still in the front-end HTML, but with an empty src="".

And, for the file, there's still a <a ...> tag, but with an empty href="".

I amended the template to remove disable-asset-panel="true" on both the image and the file, and then it works OK.

So can I disable the asset manager in blocks?

Here's my template:

<h1>
  <perch:content type="smarttext" id="heading" label="Heading" title="true" required="true" />
</h1>
<perch:blocks>
<perch:block type="block_textarea" label="Text block">
    <perch:content id="text" type="textarea" label="Text. If copying text from any other programme like Word, from an email or from a web page, right-click and select 'Paste as plain text' (only available in some web browsers)." editor="redactor" editor-config="content_text_block_main" html="true" imagewidth="960" imageheight="720" />
</perch:block>
<perch:block type="block_image" label="Image">
<img src="<perch:content type="image" id="image" label="Image" width="960" disable-asset-panel="true" />" class="cms_image <perch:content id="image_alignment" type="select" label="Choose how to align this image (optional)" options="default align left|, centre|centre, float right|float_right" />" alt="<perch:content type="smarttext" id="alt" label="Description" help="e.g. Photo of XYZ" title="true" escape="true" />">
</perch:block>
<perch:block type="block_file" label="File">
<a href="<perch:content id="file" type="file" label="File" disable-asset-panel="true" />"><perch:content type="text" id="desc" label="Title" title="true" /></a>
</perch:block>
</perch:blocks>

Here's my diagnostics:

    Perch: 3.0.8, PHP: 7.1.2, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO
    Server OS: WINNT, apache2handler
    Installed apps: content (3.0.8), assets (3.0.8), categories (3.0.8), perch_forms (1.9.1)
    App runtimes: <?php $apps_list = [ 'perch_forms', ]; ?>
    PERCH_LOGINPATH: /cms
    PERCH_PATH: C:\wamp\www\perch3\cms
    PERCH_CORE: C:\wamp\www\perch3\cms\core
    PERCH_RESFILEPATH: C:\wamp\www\perch3\cms\resources
    Image manipulation: GD
    PHP limits: Max upload 250M, Max POST 250M, Memory: 2048M, Total max file upload: 250M
    F1: 0c66c2e1f82f9e0b7617b2cb8270f2c7
    Resource folder writeable: Yes
    HTTP_HOST: perch3.local
    DOCUMENT_ROOT: C:/wamp/www/perch3
    REQUEST_URI: /cms/core/settings/diagnostics/
    SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Mark Melling

Mark Melling 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Probably best not to disable it if it's causing issues.