Skip Navigation

[Resolved] Types Beta Version 2.3-b1

This thread is resolved. Here is a description of the problem and solution.

Problem: Fatal error upon activation of Types Beta:

Fatal error: Arrays are not allowed in class constants

Solution: Update to PHP 5.6+.

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by jillT 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#575115

Completely new install on local computer using DesktopServer (xampp)

After installing Types Beta version I cannot view site, nor 'add new' of anything.

Get the following error when trying to view front end of site:

( ! ) Fatal error: Arrays are not allowed in class constants in /Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-content/plugins/types/application/models/shortcode/types/types.php on line 39
Call Stack
# Time Memory Function Location
1 0.0014 296160 {main}( ) ../index.php:0
2 0.0015 299064 require( '/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-blog-header.php' ) ../index.php:17
3 0.0017 316584 require_once( '/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-load.php' ) ../wp-blog-header.php:13
4 0.0018 326320 require_once( '/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-config.php' ) ../wp-load.php:37
5 0.0025 451064 require_once( '/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-settings.php' ) ../wp-config.php:90
6 0.2240 28356520 do_action( ) ../wp-settings.php:448
7 0.2240 28357192 WP_Hook->do_action( ) ../plugin.php:453
8 0.2240 28357288 WP_Hook->apply_filters( ) ../class-wp-hook.php:323
9 0.2724 31363144 call_user_func_array:{/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-includes/class-wp-hook.php:298} ( ) ../class-wp-hook.php:298
10 0.2725 31363688 Types_Main->on_init( ) ../class-wp-hook.php:298
11 0.2726 31367752 Types_Frontend::initialize( ) ../main.php:54
12 0.2727 31374728 Types_Shortcode_Factory->getShortcode( ) ../frontend.php:14
13 0.2727 31375008 spl_autoload_call ( ) ../frontend.php:17
14 0.2727 31375048 Toolset_Common_Autoloader->autoload( ) ../frontend.php:0

Get the following error when trying to add new custom post type, and similar when trying to add new post, page, etc.

( ! ) Parse error: syntax error, unexpected '.', expecting ')' in /Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-content/plugins/types/application/controllers/page/extension/meta_box_related_content.php on line 65
Call Stack
# Time Memory Function Location
1 0.0018 356344 {main}( ) ../admin.php:0
2 0.4308 42713568 do_action( ) ../admin.php:212
3 0.4308 42714280 WP_Hook->do_action( ) ../plugin.php:453
4 0.4308 42714376 WP_Hook->apply_filters( ) ../class-wp-hook.php:323
5 0.4310 42733096 call_user_func_array:{/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-includes/class-wp-hook.php:298} ( ) ../class-wp-hook.php:298
6 0.4310 42733688 wpcf_admin_menu_edit_type_hook( ) ../class-wp-hook.php:298
7 0.4375 43578800 Types_Admin_Edit_Post_Type->form( ) ../admin.php:639
8 0.4378 43614160 Types_Admin_Page->prepare_screen( ) ../class.types.admin.edit.post.type.php:199
9 0.4378 43614288 do_action( ) ../class.types.admin.page.php:163
10 0.4378 43615064 WP_Hook->do_action( ) ../plugin.php:453
11 0.4378 43615160 WP_Hook->apply_filters( ) ../class-wp-hook.php:323
12 0.4458 44619064 call_user_func_array:{/Users/jillterry/Documents/Websites/_ Development/pedigrees.dev/wp-includes/class-wp-hook.php:300} ( ) ../class-wp-hook.php:300
13 0.4458 44619520 spl_autoload_call ( ) ../class-wp-hook.php:300
14 0.4458 44619584 Toolset_Common_Autoloader->autoload( ) ../class-wp-hook.php:0

#575183

Thanks for the report. Is it possible to upgrade to a higher PHP version (5.6+)? Some changes were made in 5.6 that allow for array constants and constants as scalar expressions. I'm fairly certain this will resolve error 1, but I'd like to know if it has any effect on error 2.

#575198

hmm, apparently not easily with xampp!!! I'll upload it online and try it there! Will let you know.

#575205

Thank you Christian, now running on php v. 7.0.23 - that did the trick.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.