Forum

Thread tagged as: Problem, Error, Configuration

Persistent draft mode

Hello

I saw a similar post but unfortunately there didn't seem to be a resolve.

On my list/detail page all items are appearing as a draft and even when deselected and saved when you rerun to the list or item it is a draft. It seems the whole page is a draft from how it appears under pages on the dashboard.

I have updated all perch and markitup.

Added debug and tried saving after deselecting draft and got a huge output with these errors at the bottom

Invalid query: SQLSTATE[08S01]: Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes Setting alert: Content successfully updated (success) SELECT MIN(itemRev) FROM perch2_content_items WHERE regionID=48 [0] Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away DELETE FROM perch2_content_index WHERE regionID=48 AND itemRev<0 Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away SELECT * FROM perch2_content_items WHERE regionID=48 AND itemRev=179 ORDER BY itemOrder ASC Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away OPTIMIZE TABLE perch2_content_index Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away UPDATE perch2_pages SET pageModified='2016-04-07 23:51:04' WHERE pageID='21' Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away SELECT * FROM perch2_content_items WHERE regionID=48 AND itemRev=179 AND itemID=285 ORDER BY itemOrder ASC Invalid query: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away Queries: 228 Memory: 13.3672 Array ( [type] => 2 [message] => Invalid argument supplied for foreach() [file] => /var/sentora/hostdata/nickoakley/public_html/nickoakleyphotography_com/perch/core/apps/content/modes/edit.form.post.php [line] => 150 )

Denise Courtney

Denise Courtney 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

With each post to the forum we need to see:

  • Your Diagnostics Report
  • The template in question

Please post these so we can help you.

Page function:

<div class="primary-content" style="float:left; position:relative; width:100%;">
<?php
    perch_content_create('Photography', array(
      'template'   => 'portfolio_item.html',
      'multiple'    => true,
      'edit-mode' => 'listdetail',
    ));
    ?>
 <?php
    perch_content_custom('Photography', array(
      'template' => 'portfolio_listing.html',
    ));
    ?>
<br />
<br />
 </div>

Template:

            <div id="imagecontainer">
<div id="imagebox">
<div id="box"><a href="<perch:content type="image" id="image" label="image" crop="true"  order="1" width="1000" height="750"/>"  data-lightbox="image-1" data-title="<perch:content id="title" />">
 <img class="styling" src="<perch:content type="image" id="image" label="image" crop="true"  order="1" width="640" height="480"/>"  alt="<perch:content type="text" id="title" label="title" required="true" title="true" order="2" />" /></a><br /><span class="clickview">Click image for larger view</span>

</div></div></div>





<div id="imageinfo">
<div style="position:relative; float:left; width:215px;">
  <div id="titleid"><div style="width:95px; position:relative; float:left;  margin-bottom:3px; "><span class="titles">TITLE:</span></div>
 <div style="width:120px; position:relative; float:left; line-height:normal; margin-bottom:3px; "> <perch:content id="title" /></div>
</div>
    <div id="titleid"> <div style="width:95px; position:relative; float:left;  margin-bottom:3px; "><span class="titles">IMAGE ID:</span></div>  
 <div style="width:120px; position:relative; float:left;  margin-bottom:3px; "><perch:content id="imageID" type="text" required="true" label="Image ID"  /></div></div></div>
   <div id="thumb"><image src="<perch:content id="image" />" width="30" height="30" crop="true"/></div>
  <div id="deskeygroup">
 <div id="description"> <div id="destitle">DESCRIPTION:</div>
<div id="destext">  <perch:content id="desc" type="text" label="Description" /></div></div>
 <div id="keywords"> <div id="keytitle">KEYWORDS: </div>
 <div id="keytext"> <perch:content id="tag" type="text" label="Keywords" /></div></div>
  <br />

  </div>

</div>       


      <perch:categories id="albums" label="Select relevent album(s)" set="albums" divider-before="Photo Galleries"  display-as="checkboxes">
   </perch:categories>
   <div style="position:relative; float:left; width:260px; padding:15px; border:1px solid #666; border-radius:5px; color:#eee; font-family:Verdana, Geneva, sans-serif; margin-bottom:20px; margin-top:5px; text-align:left">
<h5 style="margin:0px;">Product Options </h5>

  <!----- options ---->  
     <p class="select">Select of print format</p>

  <select style="width:260px" id="target">
            <option value="">Select...</option>
      <option value="Print">PRINTS</option>
    <option value="Canvas">CANVAS</option>
    <option value="Acrylic">ACRYLIC PANELS (10mm float)</option>
     <option value="Cards">CARDS (pack of 5)</option>
        </select>


  <div id="Print" class="inv"> 
  <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin: 0px">
<input type="hidden" name="business" value="nicklives@btinternet.com">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="add" value="1">
<input type="hidden" name="item_name"
        value="<perch:content id="title" /> (<perch:content id="imageID" />)">
  <input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="quanity" value="1">
 <input type="hidden" name="on0" value="Prints">
  <input type="hidden" name="os0" value="Size: Id by Price">
 <select name="amount" style="width:260px;">
        <perch:categories id="prints" label="Select available PRINT sizes" set="prints" divider-before="Product Options" display-as="checkboxes">
    <perch:before>  <ul><option value="">Choose a size ...</option>
             </perch:before>
             <option value="<perch:category id="catPrice"/>"><perch:category id="catTitle"/><perch:if exists="catPrice"/> | £<perch:category id="catPrice"/></perch:if></option>

      <perch:after>
        </ul> 
<textarea rows="8" readonly><perch:category id="desc"/> </textarea>

      </perch:after>


   </perch:categories>
  </select>
    <div id="cart-margin"> <input type="image" name="submit" border="0" src="../../../images/add-to-cart.png"

        alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
   </div>

</form></div>
   <!----> 


      <div id="Canvas" class="inv">
        <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin: 0px">
<input type="hidden" name="business" value="nicklives@btinternet.com">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="add" value="1">
<input type="hidden" name="item_name"
        value="<perch:content id="title" /> (<perch:content id="imageID" />)">
  <input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="quanity" value="1">
<input type="hidden" name="on0" value="Canvas">
  <input type="hidden" name="os0" value="Size: Id by Price">
 <select name="amount" style="width:260px;">  
   <perch:categories id="canvas" label="Select available CANVAS sizes" set="canvas" display-as="checkboxes">
      <perch:before>  <ul><option value="">Choose a size ...</option>
             </perch:before>
                <option value="<perch:category id="catPrice"/>"><perch:category id="catTitle"/><perch:if exists="catPrice"/> | £<perch:category id="catPrice"/></perch:if></option>

      <perch:after>
        </ul> 
<textarea rows="9" readonly><perch:category id="desc"/> </textarea>
      </perch:after>

   </perch:categories> </select>
  <div id="cart-margin"> <input type="image" name="submit" border="0" src="../../../images/add-to-cart.png"

        alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
   </div>

</form></div>
 <!---->

    <div id="Acrylic" class="inv">  
  <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin: 0px">
<input type="hidden" name="business" value="nicklives@btinternet.com">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="add" value="1">
<input type="hidden" name="item_name"
        value="<perch:content id="title" /> (<perch:content id="imageID" />)">
  <input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="quanity" value="1">
<input type="hidden" name="on0" value="Acrylic">
  <input type="hidden" name="os0" value="Size: Id by Price">
 <select name="amount" style="width:260px;">

        <perch:categories id="panelsacrylic" label="Select available ACRYLIC PANELS sizes" set="panelsacrylic" display-as="checkboxes">
    <perch:before>  <ul><option value="">Choose a size ...</option>
             </perch:before>
                <option value="<perch:category id="catPrice"/>"><perch:category id="catTitle"/><perch:if exists="catPrice"/> | £<perch:category id="catPrice"/></perch:if></option>

      <perch:after>
        </ul> 
<textarea rows="12" readonly><perch:category id="desc"/> </textarea>
      </perch:after>

   </perch:categories> </select>
   <div id="cart-margin"> <input type="image" name="submit" border="0" src="../../../images/add-to-cart.png"

        alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
   </div>

</form></div>
    <!---->

       <div id="Cards" class="inv">  
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" style="margin: 0px">
<input type="hidden" name="business" value="nicklives@btinternet.com">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="add" value="1">
<input type="hidden" name="item_name"
        value="<perch:content id="title" /> (<perch:content id="imageID" />)">
  <input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="quanity" value="1">
<input type="hidden" name="on0" value="Cards">
  <input type="hidden" name="os0" value="Size: Id by Price">
 <select name="amount" style="width:260px;">
   <perch:categories id="cards" label="Select available CARD sizes" set="cards" display-as="checkboxes">
    <perch:before>  <ul><option value="">Choose a size ...</option>
             </perch:before>
                <option value="<perch:category id="catPrice"/>"><perch:category id="catTitle"/><perch:if exists="catPrice"/> | £<perch:category id="catPrice"/></perch:if></option>

       <perch:after>
        </ul> 
<textarea rows="8" readonly><perch:category id="desc"/> </textarea>
      </perch:after>

   </perch:categories> </select>


 <div id="cart-margin"> <input type="image" name="submit" border="0" src="../../../images/add-to-cart.png"

        alt="PayPal - The safer, easier way to pay online">
    <img alt="" border="0" width="1" height="1"
        src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" >
   </div>

</form>


   </div>
   <perch:content id="title" type="text" label="title" required="true" title="true" html="true" suppress="true" />
  <perch:content id="slug" for="title" type="slug" suppress="true" />
<perch:content id="image" type="image" label="Image" suppress="true" />
  <perch:category id="catSlug" for="catTitle" type="slug" suppress="true" />
     <perch:category id="catTitle" type="text" suppress="true" />

    <script>
            document
                .getElementById('target')
                .addEventListener('change', function () {
                    'use strict';
                    var vis = document.querySelector('.vis'),   
                        target = document.getElementById(this.value);
                    if (vis !== null) {
                        vis.className = 'inv';
                    }
                    if (target !== null ) {
                        target.className = 'vis';
                    }
            });
        </script>

Diagnostics: Perch: 2.8.28, PHP: 5.6.17, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO Server OS: Linux, apache2handler Installed apps: content (2.8.28), assets (2.8.28), categories (2.8.28), perch_blog (4.6), perch_forms (1.8.3), perch_gallery (2.8.6), perch_shop_paypal (1.2.1), perch_members (1.1) App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_shop_paypal', 'perch_gallery', 'perch_members', 'perch_blog', 'perch_forms', ); ?> PERCH_LOGINPATH: /perch PERCH_PATH: /var/sentora/hostdata/nickoakley/public_html/nickoakleyphotography_com/perch PERCH_CORE: /var/sentora/hostdata/nickoakley/public_html/nickoakleyphotography_com/perch/core PERCH_RESFILEPATH: /var/sentora/hostdata/nickoakley/public_html/nickoakleyphotography_com/perch/resources Image manipulation: GD PHP limits: Max upload 80M, Max POST 80M, Memory: 128M, Total max file upload: 80M F1: 2edba60ed1f613d6dd804feb202456a2 Resource folder writeable: Yes HTTP_HOST: www.nickoakleyphotography.com DOCUMENT_ROOT: /var/sentora/hostdata/nickoakley/public_html/nickoakleyphotography_com REQUEST_URI: /perch/core/settings/diagnostics/ SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Drew McLellan

Drew McLellan 2638 points
Perch Support

The region is in draft because of the query error. If the update fails, we put the region into draft so that the failure doesn't break your site.

Communication link failure: 1153 Got a packet bigger than 'max_allowed_packet' bytes 

You're sending more content through than your database server is configured to allow. Are you editing all items on one page? If so, switch the region into editing one item at a time from the options and see if that helps.

Hi Drew, I am already editing one item at a time and it makes no difference. Is this a hosting issue then?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sort of - it looks like you're sending more data to MySQL than it's configure to accept. It might simply be a factor of the amount of content you're dealing with.

Have you looked at Perch Runway at all? This is designed for larger amounts of content and so would deal with this differently in a Collection.

I haven't tried Perch Runway at all yet. Is it straight-forward to upgrade?

Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, we designed it to be (I've been upgrading all of my sites one at a time).

Instructions are here: https://docs.grabaperch.com/runway/upgrading/

It's definitely worth it if you are storing huge amounts of content in multiple item regions as you can convert those to a Collection.