Forum
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.
Can you show me the full debug? There's nothing unusual about that SQL query.
Here's the debug from the shipping methods page.
The debug from the main shop page...
And full diagnostic...
Cheers.
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...
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...
Staging server diagnostics...
Hope that's useful.
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?
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...
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...
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.
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?
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.