Support

Home Forums Event Espresso Premium PHP 7 error

PHP 7 error

Posted: May 20, 2016 at 8:34 am


wmnf

May 20, 2016 at 8:34 am

As you may know from a previous post, I am testing our website on PHP 7. I have been deactivating and activating all plugins in many different ways and unable to avoid the following error with all plugins activated:

Fatal error: Uncaught Error: Call to a member function get_page_permastruct() on null in /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/link-template.php:350 Stack trace: #0 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/link-template.php(314): _get_page_link(Object(WP_Post), false, false) #1 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/link-template.php(143): get_page_link(Object(WP_Post), false, false) #2 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-content/plugins/woocommerce/includes/wc-page-functions.php(72): get_permalink(Object(WP_Post)) #3 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-content/plugins/woocommerce/includes/wc-page-functions.php(143): wc_get_page_permalink('myaccount') #4 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/plugin.php(235): wc_lostpassword_url('http://wmnfwww....') #5 /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/general-template.php(519): apply_filters('lostpassword_ur...', 'http://w in /backup/storage/sites/wmnf/linode/www/html/wmnf/www/wp-includes/link-template.php on line 350

After activating EE4 first with all other plugins deactivated, I have found this error with several plugins when activated with EE4. However, this error does not appear when all other plugins are enabled without EE4. I have all plugins and WordPress up-to-date with Version 4.8.43.p. Let me know if you need more info and how I may be able to resolve.


wmnf

May 20, 2016 at 8:35 am

And I’d like to add, this is not an issue on our live production website with all the same versions and plugins activated. The live site is running PHP 5.4.x.


Josh

  • Support Staff

May 20, 2016 at 11:46 am

One thing that might resolve the error for you is you can try disabling the WP Basic Auth plugin that was recently bundled into EE4.

You go into /core/EE_System.core.php then go to line 199 and look for this code:
include_once EE_THIRD_PARTY . 'wp-api-basic-auth' . DS . 'basic-auth.php';
then comment it out like this and save the file:
// include_once EE_THIRD_PARTY . 'wp-api-basic-auth' . DS . 'basic-auth.php';


wmnf

May 22, 2016 at 9:21 am

Yes, that worked, all is running now without error. How will I need to handle going forward?


Tony

  • Support Staff

May 23, 2016 at 3:43 am

We will be adding an option within EE that will allow you to disable this without modifying core files.

We can’t provide details until the ticket has been confirmed and added to the next version of EE to be released but your thread has been added to that ticket so that we update this thread once that happens.


wmnf

June 3, 2016 at 7:14 am

Interestingly enough, this did not happen when we moved to PHP 7 on the production server.


wmnf

June 13, 2016 at 6:10 am

Updated to 4.9 on the development server and had to comment this out again. Just a reminder. It’s weird this only affects our dev server and not our production server. Both run PHP 7, the dev server is Ubuntu 16.04 32-bit where the production server is CentOS 7 64-bit.


wmnf

June 13, 2016 at 6:11 am

Both servers run Apache 2.24, perhaps there is a difference in my config that causes in only the dev server.


wmnf

June 13, 2016 at 6:13 am

Ah yes, of course, I’m using basic auth on the dev server, not the production server. Duh!


Josh

  • Support Staff

June 13, 2016 at 9:43 am

You could try changing line 70 of Event Espresso’s core/third_party_libs/wp-api-basic-auth/basic-auth.php so the basic auth feature loads at a lower priority. Line 70 reads as:

add_filter( 'determine_current_user', 'json_basic_auth_handler', 5 );

You change it to be:

add_filter( 'determine_current_user', 'json_basic_auth_handler', 20 );


Josh

  • Support Staff

June 16, 2016 at 1:29 pm

The above change was included in Event Espresso 4.9.1.

The support post ‘PHP 7 error’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 3 years, 5 months ago ago

Topic Tags

Tagged: ,

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.