Forum

Thread tagged as: Question, Problem, Error

Suddenly unable to save updates within (Paypal?) shop

Hello,

Re: www.emilyshomestead.com / Perch admin account is "rootcellar".

Within Perch admin > Shop > Shop + > Listing Products

When a change is made to product, clicking Save gets the following error message:

Fatal error: Call to a member function return_instance() on a non-object in /home1/gralpher/public_html/rootcellar/core/lib/api/PerchAPI_Form.class.php on line 423

Started suddenly a month or so ago according to client.

I've included the Diagnostic Report and template (hoping it's the right one) below.

Thanks for any help you can offer!

Diagnostic Report

<?php
    include(__DIR__ . '/../../inc/pre_config.php');
    include(__DIR__ . '/../../../config/config.php');
    include(PERCH_CORE . '/inc/loader.php');
    $Perch  = PerchAdmin::fetch();
    include(PERCH_CORE . '/inc/auth.php');

    if (!$CurrentUser->has_priv('perch.settings')) {
        PerchUtil::redirect(PERCH_LOGINPATH);
    }


    $Perch->page_title = PerchLang::get('Settings');
    $Alert = new PerchAlert;


    if (isset($_GET['extended'])) {
        include(__DIR__ . '/../modes/diagnostics.extended.pre.php');
    }else{
        include(__DIR__ . '/../modes/diagnostics.pre.php');
    }

    include(__DIR__ . '/../modes/diagnostics.pre.php');

    include(PERCH_CORE . '/inc/top.php');

     if (isset($_GET['extended'])) {
         include(__DIR__ . '/../modes/diagnostics.extended.post.php');
     }else{
         include(__DIR__ . '/../modes/diagnostics.post.php');
     }

    include(PERCH_CORE . '/inc/btm.php');

?>

Template

<header>
  <h2><perch:shop id="productTitle" /></h2>
</header>

<div id="single-product-column-wrapper" class="row">

    <div id="" class="single-product-left-column">
        <h3 id="single-product-subhead"><perch:shop id="leadIn" type="textarea" label="Lead In:" /></h3>
        <p><perch:shop id="productDescHTML" encode="false" /></p>
        <div id="ingredients">
        <p><span>Product Description:</span> <perch:shop id="seconDetails" type="textarea" label="Secondary details:" /></p>
        <p><span>Ingredients:</span> <perch:shop id="ingredients" type="textarea" label="Ingredients" /></p>

        <perch:if exists="particulars"><p><span>Particulars:</span> <perch:shop id="particulars" type="textarea" label="Particulars" /></p></perch:if>


        </div>
    </div>

    <div class="single-product-right-column">

        <div id="single-product-photo" class="product-photo"><div class="sale-flag <perch:shop label="Is the item currently on sale?" id="saleCondition" type="radio" options="Yes|onSale,No|noSale" wrap="div.radiowrapper" order="20"/>">on sale</div><perch:if exists="productImage">
        <img src="<perch:shop id="productImage" label="Image" type="image" width="350" height="350" crop="true" required="true" />" alt="<perch:shop id="productTitle" />" />
        </perch:if></div>

        <h6 id="single-product-reg-price" >$<perch:shop id="productPrice" /></h6> 
        <span class="<perch:shop id="saleCondition" />">
        <h6 id="sale-price">- &dollar;<perch:shop id="discountAmount" label="Discount amount (include decimals): " order="21" />*</h6></span>
        <a id="pinterest-icon" href="//www.pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.emilyshomestead.com%2Fproduct.html&media=http%3A%2F%2Fwww.emilyshomestead.com%2Fm%2Fcontent%2Fspiced-pumpkin-soap.jpg&description=Next%20stop%3A%20Pinterest" data-pin-do="buttonPin" data-pin-config="top" data-pin-color="red" data-pin-height="28"><img src="//assets.pinterest.com/images/pidgets/pinit_fg_en_rect_red_28.png" /></a>

        <div id="single-product-button">
            <perch:form id="_xclick" method="post" action="https://www.paypal.com/cgi-bin/webscr">
            <perch:input type="hidden" name="business" value="<perch:setting id="perch_shop_paypal_email" />" />
            <perch:input type="hidden" name="currency_code" value="USD" /> 
            <perch:input type="hidden" name="cmd" value="_cart" />
            <perch:input type="hidden" name="add" value="1" />     
            <perch:input type="hidden" name="item_name" value="<perch:shop id="productTitle" order="1"/>" />
            <perch:input type="hidden" name="item_number" value="<perch:shop id="productCode" order="2"/>" />
            <perch:input type="hidden" name="amount" value="<perch:shop id="productPrice" order="3"/>" />
            <perch:input type="hidden" name="productCount" value="<perch:shop id="productCount" order="4"/>" />
            <perch:input type="hidden" name="return" value="https://www.emilyshomestead.com/success.html" />
            <perch:input type="hidden" name="cancel_return" value="https://www.emilyshomestead.com/error.html" />

            <perch:input type="hidden" name="weight" value="<perch:shop  type="hidden" label="Item Type:" id="productWeight" type="radio" options="Soap/Shampoo|.31,Sm. Deodorant|.13,Lg. Deodorant|.27,Lb of Laundry Soap|1,Lotion Tube|.13,Lip Balm|.03" wrap="div.radiowrapper" />" />
            <perch:input type="hidden" name="discount_amount" value="<perch:shop id="discountAmount" format="$:%.2n" type="text" label="Amount of Discount (In USD)" order="6" />" />

            <perch:if exists="productOptions_html"><perch:shop id="productOptions_html" encode="false" type="hidden" /></perch:if>

            <h7><perch:input type="submit" name="add" value="Add to cart" /></h7>
            </perch:form>
        </div>

        <p id="availability-icon"><img src="m/content/checkmark-icon.png"> <perch:shop id="productCount" /> In Stock.</p>   
        <div class="<perch:shop id="saleCondition" />"><p id="sale-price-adjunct-single-product">*DISCOUNT APPLIED IN CART</p></div>

    </div>      
</div>
Michael Griffin

Michael Griffin 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Hi Michael

we need the actual Diagnostics Report from under Settings in the Perch Control Panel as that gives us information about your setup. Not the code of the Diagnostics Report (we already know what that looks like :) )

Rachel

Rachel,

Sorry. Here is the correct diagnostics report. Thanks!

Viewing Diagnostic Information
Diagnostics report
HEALTH CHECK

Perch is up to date
PHP 5.4.45 version is okay, but a little out of date. Consider updating soon.
MySQL 5.5.42-37.1 is up to date
Image processing available
SUMMARY INFORMATION

Perch: 2.8.21, PHP: 5.4.45, MySQL: 5.5.42-37.1, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.21), assets (2.8.21), categories (2.8.21), perch_forms (1.7), perch_shop_paypal (1.2.1)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_shop_paypal', 'perch_forms', );
PERCH_LOGINPATH: /rootcellar
PERCH_PATH: /home1/gralpher/public_html/rootcellar
PERCH_CORE: /home1/gralpher/public_html/rootcellar/core
PERCH_RESFILEPATH: /home1/gralpher/public_html/rootcellar/resources
Image manipulation: GD Imagick
PHP limits: Max upload 64M, Max POST 64M, Memory: 256M, Total max file upload: 64M
Resource folder writeable: Yes
DOCUMENT_ROOT: /home1/gralpher/public_html
HTTP_HOST: emilyshomestead.com
REQUEST_URI: /rootcellar/core/settings/diagnostics/
SCRIPT_NAME: /rootcellar/core/settings/diagnostics/index.php

Rachel,

Just in case, here is the extended diagnostic report:

Diagnostics report
PERCH INFORMATION

Perch: 2.8.21
Production mode: Production (100)
Installed apps: content (2.8.21), assets (2.8.21), categories (2.8.21), perch_forms (1.7), perch_shop_paypal (1.2.1)
DB driver: PDO
DB tables: perch2_categories, perch2_category_counts, perch2_category_sets, perch2_content_index, perch2_content_items, perch2_content_regions, perch2_forms, perch2_forms_responses, perch2_navigation, perch2_navigation_pages, perch2_page_templates, perch2_pages, perch2_resource_log, perch2_resource_tags, perch2_resources, perch2_resources_to_tags, perch2_settings, perch2_shop_categories, perch2_shop_log, perch2_shop_orders, perch2_shop_product_options, perch2_shop_products, perch2_shop_products_to_categories, perch2_user_passwords, perch2_user_privileges, perch2_user_role_privileges, perch2_user_roles, perch2_users
Users: 3
App runtimes:
<?php
    $apps_list = array(
        'content', 
        'categories',
        'perch_shop_paypal',
        'perch_forms',
    );
Editor plug-ins: markitup
H1: edf8489b2bf437a75766790f9aa1caa1
L1: c0872d63d6730ba9113d50091942ca03
headerColour: #2D5961
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.6.2: done
latest_version: 2.8.15
on_sale_version: 2.8.21
headerScheme: dark
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
logoPath: /rootcellar/resources/eh-main-logo-235-sq.png
perch_shop_paypal_email: emilyseaver6@gmail.com
perch_shop_product_url: product.php?s={productSlug}
perch_shop_display_oos: 0
update_2.8.18: done
update_2.8.21: done
update_2.8.13: done
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: gralpher_emily
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: gralpher_homestead
PERCH_DB_PREFIX: perch2_
PERCH_TZ: America/Chicago
PERCH_EMAIL_FROM: perchalerts@emilyshomestead.com
PERCH_EMAIL_FROM_NAME: Emily Griffin
PERCH_LOGINPATH: /rootcellar
PERCH_PATH: /home1/gralpher/public_html/rootcellar
PERCH_CORE: /home1/gralpher/public_html/rootcellar/core
PERCH_RESFILEPATH: /home1/gralpher/public_html/rootcellar/resources
PERCH_RESPATH: /rootcellar/resources
PERCH_HTML5: 1
PERCH_CLEAN_RESOURCES:
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_DEBUG:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /home1/gralpher/public_html/rootcellar/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
HOSTING SETTINGS

PHP: 5.4.45
Zend: 2.4.0
OS: Linux
SAPI: cgi-fcgi
Safe mode: not detected
MySQL client: 5.5.42-37.1
MySQL server: 5.5.42-37.1
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, gettext, gmp, SPL, iconv, session, intl, json, mbstring, mcrypt, mssql, mysql, mysqli, odbc, standard, PDO, pdo_mysql, pdo_sqlite, Phar, posix, pspell, Reflection, imap, SimpleXML, soap, sockets, exif, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, cgi-fcgi, imagick, SourceGuardian, mhash, ionCube Loader, Zend Guard Loader
GD: Yes
ImageMagick: Yes
PHP max upload size: 64M
PHP max form post size: 64M
PHP memory limit: 256M
Total max uploadable file size: 64M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
DOCUMENT_ROOT: /home1/gralpher/public_html
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING: gzip, deflate
HTTP_ACCEPT_LANGUAGE: en-us
HTTP_CONNECTION: close
HTTP_COOKIE: _gat=1; _ga=GA1.2.383614126.1428975403; PHPSESSID=84a6cf9e2c58b6723bc5e80ff6ed84d1; cmsa=1
HTTP_DNT: 1
HTTP_HOST: emilyshomestead.com
HTTP_REFERER: https://emilyshomestead.com/rootcellar/core/settings/diagnostics/
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/6.1.6 Safari/537.78.2
HTTP_X_HTTP_PROTO: HTTP/1.1
HTTP_X_LOG_7520: 74.179.212.102
HTTP_X_REAL_IP: 74.179.212.102
PATH: /bin:/usr/bin
PHPRC: /opt/phpcur/lib
QUERY_STRING: extended
REDIRECT_STATUS: 200
REMOTE_ADDR: 74.179.212.102
REMOTE_PORT: 44049
REQUEST_METHOD: GET
REQUEST_URI: /rootcellar/core/settings/diagnostics/?extended
SCRIPT_FILENAME: /home1/gralpher/public_html/rootcellar/core/settings/diagnostics/index.php
SCRIPT_NAME: /rootcellar/core/settings/diagnostics/index.php
SERVER_ADDR: 50.87.146.63
SERVER_ADMIN: webmaster@emilyshomestead.com
SERVER_NAME: emilyshomestead.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.1
SERVER_SIGNATURE: <address>Apache Server at emilyshomestead.com Port 80</address>
SERVER_SOFTWARE: Apache
UNIQUE_ID: VovjhDJXkBAAAIn-NiEAAAFz
PHP_SELF: /rootcellar/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1452008324.25
REQUEST_TIME: 1452008324
argc: 1
Drew McLellan

Drew McLellan 2638 points
Perch Support

When you say suddenly - what changed?

As far as I can tell, nothing.

The client has been using the payal shop app to manage her products. Up until recently it has been working fine. As of a month or so ago she began getting the fatal error when she tried to save any changes. So she can't update the product descriptions, prices, etc. any more.

As I always do, I upgraded her to the latest version of Perch - perch_v2.8.18 - at the end of November. Simply replaced the core folder with the newest one. Upgrading hasn't been a problem before.

The first thing I did when I heard of the problem was downgrade to the previous version of Perch to see if that eliminated the problem, since it was working previously, but I got the same fatal error.

Same results with the very latest version of Perch.

Could the client have done something in the normal client use of Perch to break the process?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I'll see what I can find out!

Hi Drew,

Is there anything else I can provide that would be helpful?

Drew,

This is now resolved.

I found a post on this forum where someone was getting the exact same fatal error message, only by way of their blog add-on app. Just needed to have the blog updated. Doh!

So I simply updated the shop_paypal app and that fixed the problem. Now I know to keep the apps updated along with Perch itself. Cheers.