Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify minimum Genesis version when supported by Genesis #172

Open
ghost opened this issue Jan 2, 2019 · 9 comments
Open

Specify minimum Genesis version when supported by Genesis #172

ghost opened this issue Jan 2, 2019 · 9 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Jan 2, 2019

after downloading and upon activating the Genesis Sample theme I get an error.

Fatal error: Uncaught Error: Call to undefined function genesis_get_config() in /Users/brodyr/Documents/sites/wordpress/wp-content/themes/genesis-sample-develop/functions.php:131 

Stack trace: 

#0 /Users/brodyr/Documents/sites/wordpress/wp-settings.php(441): include() 

#1 /Users/brodyr/Documents/sites/wordpress/wp-config.php(91): require_once('/Users/brodyr/D...') 

#2 /Users/brodyr/Documents/sites/wordpress/wp-load.php(37): require_once('/Users/brodyr/D...') 

#3 /Users/brodyr/Documents/sites/wordpress/wp-admin/admin.php(31): require_once('/Users/brodyr/D...') 

#4 /Users/brodyr/Documents/sites/wordpress/wp-admin/themes.php(10): require_once('/Users/brodyr/D...') 

#5 {main} thrown in /Users/brodyr/Documents/sites/wordpress/wp-content/themes/genesis-sample-develop/functions.php on line 131

@marybaum
Copy link

marybaum commented Jan 2, 2019

Yup! I've got it too.

`

( ! ) Fatal error: Uncaught Error: Call to undefined function genesis_get_config() in /Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-content/themes/genesis-sample/functions.php on line 131

1 | 0.0051 | 538240 | {main}( ) | .../index.php:0
2 | 0.0052 | 540192 | require( '/Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-blog-header.php' ) | .../index.php:17
3 | 0.0055 | 552792 | require_once( '/Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-load.php' ) | .../wp-blog-header.php:13
4 | 0.0056 | 563776 | require_once( '/Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-config.php' ) | .../wp-load.php:37
5 | 0.0064 | 648464 | require_once( '/Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-settings.php' ) | .../wp-config.php:90
6 | 0.5636 | 48658192 | include( '/Users/marybaum/Sites/dts 3.8.5/proshop.dev.cc/wp-content/themes/genesis-sample/functions.php' ) | .../wp-settings.php:441

`

@nathanrice
Copy link
Contributor

If you're not running the Genesis 2.8 Beta, you'll get this error.

Try installing the Genesis 2.8 Beta and let us know if that fixes you up.

@marybaum
Copy link

marybaum commented Jan 2, 2019

Will do!

@marybaum
Copy link

marybaum commented Jan 2, 2019

Worked a treat, of course! Had cruised over here figuring there had to be a version with the new function

@ghost
Copy link
Author

ghost commented Jan 2, 2019

when will you release 2.8?

@nickcernis
Copy link
Collaborator

@broros Genesis 2.8.0 is currently scheduled for 16 January 2019, although that may change. You can try it now using the Genesis Beta Tester plugin if you wish: https://wordpress.org/plugins/genesis-beta-tester/

Genesis Sample 2.8.0 will likely be released at the same time or shortly afterwards.

@eclectic-coding
Copy link

So this error reported and confirmed by @marybaum and @broros raises and interesting question. Will there be any error checking or backward compatibility added to genesis-sample? As it stands now, any user who installs the theme (v. 2.8) without updating Genesis first, will be confronted with the same error.

Overall, I love the idea of a move to configuration loading with genesis_get_config'. I find it interesting the files used so far in ./configare :html, menus, accessibility, and custom-logo. These files can be loaded as: i.e. add_theme_support( 'genesis-accessibility', genesis_get_config( 'accessibility' ) );`

However each of these files are still in the core and can be loaded as:
i.e. add_theme_support( 'genesis-accessibility' );

Are all theme_supports begin moved to config? Or is config a place where a developer can expand the way themes are designed? I am concerned that without backward compatibility or error checks, it may become problematic.

@nickcernis
Copy link
Collaborator

nickcernis commented Jan 10, 2019

Will there be any error checking or backward compatibility added to genesis-sample?

We've not done this in the past for other versions of Genesis Sample that required specific versions of Genesis, although I believe this is the first time users will see a fatal error if they're not running the latest Genesis so I agree it's worth considering.

Ideally it should be the role of WordPress core to determine minimum parent theme, WordPress, and PHP versions for plugins and themes. There was a proposal for a parent theme minimum version check on activation, but it was recently closed due to inactivity.

For now we could:

  • Check for genesis_get_config() in functions.php
  • Display a message in the admin area, and exit functions.php early if it's not available.

I'm not sure this is a massive improvement on throwing a fatal error (because the theme still won't work as expected), but at least it's more user friendly.

Are all theme_supports being moved to config? Or is config a place where a developer can expand the way themes are designed?

The Genesis configuration API in Genesis 2.8 lets child theme developers do two things:

  1. Override certain Genesis parent theme settings by placing a config file of the same name as the parent theme file in your child theme.
  2. Load PHP configuration data that was scattered throughout a child theme from a consistent central location (the child theme's config folder).

There will be full documentation on the whys and hows of this when Genesis 2.8 launches (or shortly after).

@dreamwhisper dreamwhisper added this to the Genesis Sample 2.8 milestone Jan 10, 2019
@nickcernis nickcernis self-assigned this Jan 14, 2019
@nickcernis
Copy link
Collaborator

We've decided to abstain from adding minimum Genesis version checking logic in the child theme for now. Instead, we'll investigate ways to move that logic to Genesis itself and have child themes specify their minimum requirements in a more simple way.

Requirements API for specifying minimum Genesis version in child themes
https://github.com/studiopress/genesis/issues/2123

I'm leaving this open so we can (a) track the impact of this in support and (b) add version checking requirements if/when Genesis implements an API for it.

@nickcernis nickcernis changed the title Error: Call to undefined function genesis_get_config() Specify minimum Genesis version when supported by Genesis Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants