Forum

Thread tagged as: Problem, Error, Shop

Error thrown when attempting to enter shipping method.

Setting up my first Shop build, following the instructions on the getting started guide. But when I attempt to set up a shipping method I get the following error...

( ! ) Fatal error: Call to a member function index() on a non-object in C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\addons\apps\perch_shop\modes\shipping.edit.pre.php on line 45

Not sure if it's relevant, but I'm getting this in debug...

SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_shippings WHERE 1=1 AND shippingDeleted IS NULL ORDER BY shippingOrder ASC LIMIT 0, 1

Diagnostics...

Perch: 2.8.30, PHP: 5.5.12, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.8.30), assets (2.8.30), categories (2.8.30), perch_blog (5.0), perch_forms (1.8.3), perch_gallery (2.8.6), perch_shop_orders (1.0.6), perch_shop_products (1.0.6), perch_shop (1.0.6), perch_members (1.5), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_gallery', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch
PERCH_CORE: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\core
PERCH_RESFILEPATH: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 3M, Memory: 128M, Total max file upload: 3M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: longshot-photo
DOCUMENT_ROOT: C:/Users/Mark/Documents/Web Design Local/host/longshot-photo
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Thanks.

Mark Phoenix

Mark Phoenix 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me the full debug? There's nothing unusual about that SQL query.

Here's the debug from the shipping methods page.

Debug Message
[1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='782001f47623a0fa1538bb6d6fa4e564' LIMIT 1
UPDATE perch2_users SET userHash='15653e8c3c7cd1f51d9096de2601dca7' WHERE userID='1'
[82] SELECT p.privKey FROM perch2_user_privileges p
[48] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID
Using template: \addons\apps\perch_shop\templates\shop\shippings\shipping.html
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode
[4] SELECT * FROM perch2_shop_shipping_zones ORDER BY zoneTitle ASC
[1] SELECT * FROM perch2_shop_tax_groups WHERE 1=1 AND groupDeleted IS NULL ORDER BY groupTitle ASC
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode
[1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode
Queries: 10
Memory: 6.0019

The debug from the main shop page...


Debug Message [1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='127c13e19f61f150868c01f61642fc66' LIMIT 1 UPDATE perch2_users SET userHash='3f6df4785d152cb9229948675b7fa175' WHERE userID='1' [82] SELECT p.privKey FROM perch2_user_privileges p [48] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID [nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_products WHERE 1=1 AND productDeleted IS NULL ORDER BY title ASC LIMIT 0, 1 [0] SELECT FOUND_ROWS() AS `count` Attempting app installation: perch_shop [1] SHOW TABLES LIKE "perch2_shop_products" [1] SELECT * FROM perch2_category_sets WHERE setSlug='products' LIMIT 1 [1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode [1] SELECT * FROM perch2_shop_tax_locations WHERE locationIsHome='1' AND locationDeleted IS NULL LIMIT 1 [1] SELECT * FROM perch2_shop_tax_locations WHERE locationIsDefault='1' AND locationDeleted IS NULL LIMIT 1 [1] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_tax_groups WHERE 1=1 AND groupDeleted IS NULL ORDER BY groupTitle ASC LIMIT 0, 1 [1] SELECT FOUND_ROWS() AS `count` [1] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_shipping_zones ORDER BY zoneTitle ASC LIMIT 0, 1 [4] SELECT FOUND_ROWS() AS `count` [nil] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_shippings WHERE 1=1 AND shippingDeleted IS NULL ORDER BY shippingOrder ASC LIMIT 0, 1 [0] SELECT FOUND_ROWS() AS `count` [1] SELECT SQL_CALC_FOUND_ROWS DISTINCT * FROM perch2_shop_brands WHERE 1=1 AND brandDeleted IS NULL ORDER BY brandTitle ASC LIMIT 0, 1 [1] SELECT FOUND_ROWS() AS `count` Queries: 20 Memory: 5.4258

And full diagnostic...

Perch: 2.8.30
Production mode: Production (100)
Installed apps: content (2.8.30), assets (2.8.30), categories (2.8.30), perch_blog (5.0), perch_forms (1.8.3), perch_gallery (2.8.6), perch_shop_orders (1.0.6), perch_shop_products (1.0.6), perch_shop (1.0.6), perch_members (1.5), perch_backup (1.2)
DB driver: PDO
DB tables: perch2_blog_authors (4), perch2_blog_comments (0), perch2_blog_index (893), perch2_blog_posts (14), perch2_blog_posts_to_tags (46), perch2_blog_sections (1), perch2_blog_tags (41), perch2_blogs (1), perch2_categories (15), perch2_category_counts (10), perch2_category_sets (3), perch2_content_index (1488), perch2_content_items (156), perch2_content_regions (36), perch2_forms (1), perch2_forms_responses (3), perch2_gallery_albums (3), perch2_gallery_image_versions (273), perch2_gallery_images (128), perch2_kraken_jobs (54), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (1), perch2_pages (11), perch2_resource_log (1183), perch2_resource_tags (1), perch2_resources (784), perch2_resources_to_tags (5), perch2_settings (49), perch2_shop_addresses (0), perch2_shop_admin_index (0), perch2_shop_brands (1), perch2_shop_cart (2), perch2_shop_cart_data (0), perch2_shop_cart_items (0), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (0), perch2_shop_emails (1), perch2_shop_index (11), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (0), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (0), perch2_shop_orders_meta (1), perch2_shop_product_files (0), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (0), perch2_shop_promotions (0), perch2_shop_search (0), perch2_shop_shipping_zone_countries (46), perch2_shop_shipping_zones (4), perch2_shop_shippings (0), perch2_shop_tax_exhibits (0), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (0), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (82), perch2_user_role_privileges (61), perch2_user_roles (3), perch2_users (3)
Users: 3
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_gallery',
        'perch_blog',
        'perch_forms',
        'perch_members',
        'perch_shop',
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Editor plug-ins: ckeditor, markitup, redactor, tinymce
H1: a0d6199f0bf0a96f9f1bc961d2b85ef3
L1: 58171556e8cc89b5374107af83086924
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #e8e8e8
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 1
content_collapseList: 0
lang: en-gb
update_2.7.10: done
on_sale_version: 2.8.30
perch_gallery_update: 2.8.5
update_2.8.2: done
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
update_2.8.4: done
headerScheme: light
perch_gallery_bucket_mode: single
perch_gallery_bucket: default
perch_blog_slug_format: %Y-%m-%d-{postTitle}
perch_blog_akismet_key:
perch_blog_max_spam_days: 0
perch_backup_mysqldump_path:
dashboard: 1
hide_pwd_reset: 0
content_hideNonEditableRegions: 1
content_frontend_edit: 0
perch_gallery_basicUpload: 0
perch_blog_comment_notify: 0
update_2.8.6: done
update_2.8.7: done
perch_kraken_api_key: e1d821f52f0312d2a50e7b3c32ba3860
perch_kraken_api_secret: beff497397153a06440ea09b2116737ca5e536e3
perch_kraken_url: https://longshot.photo/
perch_kraken_dev_mode:
latest_version: 2.8.15
update_2.8.18: done
logoPath: /perch/resources/perch-local-login-logo.png
update_2.8.26: done
perch_blog_site_name:
update_2.8.29: done
update_2.8.30: done
perch_shop_update: 1.0.6
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /shop/products/{slug}
perch_shop_default_currency: 47
perch_shop_reporting_currency: 47
perch_shop_invoice_number_format: Invoice%d
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: longshot_local
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Europe/London
PERCH_EMAIL_FROM: markrphoenix@gmail.com
PERCH_EMAIL_FROM_NAME: Mark Phoenix
PERCH_LOGINPATH: /perch
PERCH_PATH: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch
PERCH_CORE: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\core
PERCH_RESFILEPATH: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
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_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\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_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.6
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.5.12
Zend: 2.5.0
OS: WINNT
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $
MySQL server: 5.6.17
Free disk space: 344.43 GB
Extensions: Core, bcmath, calendar, ctype, date, ereg, filter, ftp, hash, iconv, json, mcrypt, SPL, odbc, pcre, Reflection, session, standard, mysqlnd, tokenizer, zip, zlib, libxml, dom, PDO, bz2, SimpleXML, wddx, xml, xmlreader, xmlwriter, apache2handler, openssl, curl, com_dotnet, fileinfo, gd, gettext, gmp, imap, mbstring, exif, mysql, mysqli, Phar, pdo_mysql, pdo_sqlite, shmop, soap, sockets, sqlite3, xmlrpc, xsl, mhash, xdebug
GD: Yes
ImageMagick: No
PHP max upload size: 64M
PHP max form post size: 3M
PHP memory limit: 128M
Total max uploadable file size: 3M
Resource folder writeable: Yes
Session timeout: 30 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: No
HTTP_COOKIE: _ga=GA1.1.1075936967.1467472953; cmsa=1; PHPSESSID=9oaktu0rcojvnfuobldq047it2
HTTP_ACCEPT_LANGUAGE: en,en-GB;q=0.8
HTTP_REFERER: https://localhost:8001/perch/core/settings/diagnostics/
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_CONNECTION: close
HTTP_HOST: longshot-photo
PATH: C:\Ruby22\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files\TortoiseHg\;C:\Program Files (x86)\Git\cmd;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\nodejs\;C:\Program Files (x86)\Brackets\command;
SystemRoot: C:\WINDOWS
COMSPEC: C:\WINDOWS\system32\cmd.exe
PATHEXT: .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW
WINDIR: C:\WINDOWS
SERVER_SIGNATURE: <address>Apache/2.4.9 (Win64) PHP/5.5.12 Server at longshot-photo Port 80</address>
SERVER_SOFTWARE: Apache/2.4.9 (Win64) PHP/5.5.12
SERVER_NAME: longshot-photo
SERVER_ADDR: 127.0.0.1
SERVER_PORT: 80
REMOTE_ADDR: 127.0.0.1
DOCUMENT_ROOT: C:/Users/Mark/Documents/Web Design Local/host/longshot-photo
REQUEST_SCHEME: http
CONTEXT_DOCUMENT_ROOT: C:/Users/Mark/Documents/Web Design Local/host/longshot-photo
SERVER_ADMIN: admin@example.com
SCRIPT_FILENAME: C:/Users/Mark/Documents/Web Design Local/host/longshot-photo/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 53391
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1467699238.926
REQUEST_TIME: 1467699238

Cheers.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get anything logged in your error log?

Will the production server also be Windows?

The production & staging servers are both Linux. Getting the following in the local build error log...

[05-Jul-2016 07:12:12 Europe/London] PHP Stack trace:

[05-Jul-2016 07:12:12 Europe/London] PHP   1. {main}() C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\addons\apps\perch_shop\shippings\edit\index.php:0

[05-Jul-2016 07:12:12 Europe/London] PHP   2. include() C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\addons\apps\perch_shop\shippings\edit\index.php:4

[05-Jul-2016 07:12:12 Europe/London] PHP   3. include() C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\addons\apps\perch_shop\_default_index.php:22

[05-Jul-2016 07:16:15 Europe/London] PHP Fatal error:  Call to a member function index() on a non-object in C:\Users\Mark\Documents\Web Design Local\host\longshot-photo\perch\addons\apps\perch_shop\modes\shipping.edit.pre.php on line 45

Getting the following error thrown on the on the staging server shop page...

Fatal error: Call to a member function index() on null in /home/pixelsmi/public_html/clients/dev4/perch/addons/apps/perch_shop/modes/shipping.edit.pre.php on line 45

Only thing in the error log is below...

[Tue Jul 05 17:00:50.419607 2016] [access_compat:error] [pid 16137] [client 180.76.15.19:41098] AH01797: client denied by server configuration: /home/pixelsmi/public_html/clients/dev/

Here's the staging server debug from the shop page...


Debug Message [1] SELECT u.*, r.* FROM perch2_users u, perch2_user_roles r WHERE u.roleID=r.roleID AND u.userEnabled=1 AND u.userID=1 AND u.userHash='674607f132ed009086ec2fa07796fa86' LIMIT 1 UPDATE perch2_users SET userHash='fce168df0bc4b37ee9f74f817c89af6a' WHERE userID='1' [82] SELECT p.privKey FROM perch2_user_privileges p [48] SELECT * FROM (SELECT DISTINCT settingID, settingValue, userID FROM perch2_settings WHERE userID=1 OR userID=0 ORDER BY userID DESC) AS settings GROUP BY settingID, settingValue, userID Using template: /addons/apps/perch_shop/templates/shop/shippings/shipping.html [1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode [4] SELECT * FROM perch2_shop_shipping_zones ORDER BY zoneTitle ASC [1] SELECT * FROM perch2_shop_tax_groups WHERE 1=1 AND groupDeleted IS NULL ORDER BY groupTitle ASC [1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode [1] SELECT * FROM perch2_shop_currencies WHERE currencyActive=1 ORDER BY currencyID=47 DESC, currencyCode Queries: 10 Memory: 4.5743

Staging server diagnostics...

Perch: 2.8.30, PHP: 5.6.22, MySQL: 5.5.32, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.30), assets (2.8.30), categories (2.8.30), perch_blog (5.0), perch_forms (1.8.3), perch_gallery (2.8.6), perch_shop_orders (1.0.6), perch_shop_products (1.0.6), perch_shop (1.0.6), perch_members (1.5), perch_backup (1.2)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_gallery', 'perch_blog', 'perch_forms', 'perch_members', 'perch_shop', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/pixelsmi/public_html/clients/dev4/perch
PERCH_CORE: /home/pixelsmi/public_html/clients/dev4/perch/core
PERCH_RESFILEPATH: /home/pixelsmi/public_html/clients/dev4/perch/resources
Image manipulation: GD
PHP limits: Max upload 128M, Max POST 128M, Memory: 768M, Total max file upload: 128M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: dev4.pixelsmiths.co.uk
DOCUMENT_ROOT: /home/pixelsmi/public_html/clients/dev4
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

Hope that's useful.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That AH01797 error looks like it's coming from your server. Did you build it yourself, or is it some sort of packaged environment?

It's a packaged environment. So would it be causing the problem even though the Shop build is on a different subdomain?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't know if subdomains would be an issue here, as the error doesn't appear to be coming from Perch.

Okay. I'll run it by my hosting provider.

Still getting white screen of death after attempting to save a shipping method...

Perch Error Screenshot The error message at the top of the screen is Fatal error: Call to a member function index() on null in /home/pixelsmi/public_html/clients/dev4/perch/addons/apps/perch_shop/modes/shipping.edit.pre.php on line 45

And this is the verdict from my hosting provider...

Perch Error Screenshot

The AH01797 error is occurring on an entirely different subdomain to the one the Perch install in question is on so I'm not sure why it would be white screening me.

Drew McLellan

Drew McLellan 2638 points
Perch Support

The error from Perch is symptomatic of the creation failing - it is not the problem itself. Showing that error to your hosting provider isn't going to help.

The AH01797 error is from a different site? That's a red herring then. If I'm going to be able to help I need clear information about the site actually experiencing the problem.

Are you logging errors on your MySQL server? Are you completing all the fields in the form?

After a certain amount of barking up some wrong trees seems the error occurs when the priority box is left blank while creating a shipping method. Want any more info on this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, that sounds about right. It should ideally be required in the template. You can't have a shipping method with no priority.

Thanks Drew. I've marked it as required in the template.