Forum

Thread tagged as: Problem

dataselect issue - choking edit form

Hi,

I seem to be encountering an issue with dataselects, the first dataselect works fine (teacher), but the dataselect venue comes a cropper as soon as I add a venue to that region.

Part of the class template:

  <a href="/teachers/<perch:content id="class-teacher-slug" type="slug" for="class-teacher" />">
        <perch:content id="class-teacher" label="Teacher" type="dataselect" page="/teachers/index.php" region="Teacher" options="teacher-fullname" />
  </a>

    <a href="/venues/<perch:content id="class-venue-slug" type="slug" for="class-venue" />">
        <perch:content id="class-venue" label="Venue" type="dataselect" page="/venues/index.php" region="Venue" options="venue-shortname" />
  </a>

The class edit page in Perch cuts the form off just after the Venue label, so I don't have any debug info available. Removing the teachers dataselect doesn't make any difference, nor does moving the order of the dataselect in the document, it seems to specific to the venue dataselect.

Here's the venue template:

<div class="venue-details">

  <perch:content id="venue-visibility" type="checkbox" label="Show" value="show" help="Show on the site" suppress="true" />

    <perch:content id="venue-shortname" type="smarttext" label="Short Name" required="true" help="A short distinctive name eg. 'Didsbury' (how you'd refer to this place out loud)" suppress="true" />

    <h2 class="venue-name"><perch:content id="venue-name" type="smarttext" label="Name" required="true" title="true" help="Full name eg. 'The Parsonage, Didsbury'" /></h2>

    <address>
        <perch:content id="venue-address" type="textarea" label="Venue Address" size="s" />
        <perch:content id="venue-postcode" type="text" label="Postcode" size="m" />
    </address>

    <perch:if exists="image">
    <img class="venue-photo" src="<perch:content type="image" id="venue-photo" label="Image" width="2048" height="2048" bucket="venues" />" />
    </perch:if>

    <perch:if exists="venue-tel">
        <perch:content id="venue-tel" type="text" label="Telephone" size="m" />
    </perch:if>
    <perch:if exists="venue-email">
        <a href="mailto:<perch:content id="venue-email" type="text" label="Email" />"><perch:content id="venue-email" /></a>
    </perch:if>
    <perch:if exists="venue-url">
        <perch:content id="venue-url" type="text" label="Website" replace="https://|,https://|" />
    </perch:if>

    <div class="venue-map"><perch:content id="venue-map" type="map" label="Map" width="300" height="300" zoom="15" /></div>

    <div class="venue-description">
    <perch:content id="venue-description" type="textarea" label="Description" textile="true" editor="markitup" />
    </div>

    <perch:content id="venue-shortdescription" type="textarea" size="s" label="Short Description" help="This is short description that will appear in Google or on Facebook, etc." suppress="true" />

</div>

<perch:content id="slug" type="slug" for="venue-name" suppress="true" />

I'm sure i'm missing something obvious here, but can't work it out. Help appreciated!

Oh yeah, summary info:

SUMMARY INFORMATION

Perch: 2.8.13, PHP: 5.5.26, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 15d5c781cfcad91193dceae1d2cdd127674ddb3e $, with PDO
Server OS: Darwin, cgi-fcgi
Installed apps: content (2.8.13), assets (2.8.13), categories (2.8.13), perch_events (1.9.2), perch_moltin_orders (1.0), perch_moltin_products (1.0), perch_moltin (1.0), perch_members (1.4)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_events', 'perch_members', 'perch_moltin' );
PERCH_LOGINPATH: /cms
PERCH_PATH: /Users/mikefallows/Repos/theyogarooms/cms
PERCH_CORE: /Users/mikefallows/Repos/theyogarooms/cms/core
PERCH_RESFILEPATH: /Users/mikefallows/Repos/theyogarooms/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
Resource folder writeable: Yes
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
REQUEST_URI: /cms/core/settings/diagnostics/
DOCUMENT_ROOT: /Users/mikefallows/Repos/theyogarooms
HTTP_HOST: theyogarooms:xxxxx

Thanks

M.

Mike Fallows

Mike Fallows 2 points

  • 6 years ago

Aha! It doesn't like the dataselect options value to point to a smarttext fieldtype. Changing it to just a text type solved it.

Is it possible to store a plain text field and then smarttext it with another field (like you can with slug)? Bit of an edge case admittedly.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Dataselect only works with the basic atomic field types - anything that stores a structure will cause you issues. For that you need relationships.

Thanks for the clarification, Drew. I just got a bit giddy and added smarttext everywhere. Lesson learned.