Community Forums › Forums › Archived Forums › General Discussion › Error after upgrade
Tagged: error, Genesis upgrade
- This topic has 10 replies, 3 voices, and was last updated 10 years, 10 months ago by Bill Murray.
-
AuthorPosts
-
June 29, 2013 at 9:05 am #48364alyssaavantMember
I just upgraded Genesis on a client's website and got this error
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '__genesis_return_full_width_content' not found or invalid function name in /data/15/3/39/84/3039247/user/3376353/htdocs/inspiration-university/wp-includes/plugin.php on line 170
class="home blog header-full-width content-sidebar">HELP!
http://inspiration-university.comJune 29, 2013 at 1:52 pm #48389echofoxtrotMemberDo you have white space at the top of your functions.php file? Try removing that if you do. Also, this could be a plugin problem since there is a reference to plugin.php. Try disabling all the plugins and then reactivating them. If you have recently added a plugin you could start with just deactivating that one first.
June 30, 2013 at 7:19 am #48525alyssaavantMemberDisabled ALL plugins. still not fixed. No white space at top of Functions.php
June 30, 2013 at 8:35 am #48536echofoxtrotMemberI found this on the WordPress forum - it's 2 years old, but give it a shot. If you have this line in your functions.php file, comment it out (don't delete it.)
add_action('init', 'cp_admin_init');
Here is the link to the original thread: http://wordpress.org/support/topic/warning-call_user_func_array-functioncall-user-func-array?replies=12
June 30, 2013 at 8:54 am #48543Bill MurrayMember@alyssaavant - The problem is likely in your child theme's functions.php file. Post the entire contents to a Pastebin and then post a link back here so that people can have a look at it.
If you have any caching plugins, be sure to clear all caches after your upgrade; it's a good idea to disable caching while debugging a problem.
@echofoxtrot - Good effort. FYI, the reference to plugin.php is misleading and needs to be ignored. Whitespace won't really cause an invalid function name error; it might trigger a headers already sent error, but this is often due to how the file terminates vs how it starts. Invalid function name errors are usually just what that says: there's a function used in the code that doesn't exist once all the code for that page where the function is called is loaded.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
June 30, 2013 at 9:07 am #48547echofoxtrotMemberBill, good to know. Thanks!
June 30, 2013 at 9:31 am #48549Bill MurrayMember@echofoxtrot - Just to be a little more specific, wp-includes/plugin.php is the WP code that processes code such as apply_filters() or add_action(), etc. Under WP 3.5.2 (the OP didn't specify her WP version), around line 170 is the code to apply_filters(). The OP most likely has code in her functions.php that attempts to apply a filter to set a full width page template, but the name has changed from an older Genesis version to a newer one. When plugin.php attempted to apply the filter set in the child theme, it produced an error and reported it on line 170, even though that is not the real problem because the real problem is where the apply_filters() code is used in the child theme.
This is a common situation with WP code & PHP. If the error is reported in a core WP file, unless your WP installation is damaged, that's not the real error. WP is too well tested & widely used for a basic error to exist in a properly set up WP installation. So when you see an error referencing a core WP file, you have to look for other clues to what is the real source of the problem.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
June 30, 2013 at 9:46 am #48550echofoxtrotMemberBill, excellent advice and totally makes sense, now that you explain it that way. Now, might that mean that there's a potential problem when upgrading Genesis child themes?
June 30, 2013 at 10:20 am #48554Bill MurrayMember@echofoxtrot - It depends on what you mean by "potential problem".
If you have a very old version of Genesis and jump several major versions at once, then there is a bigger chance of problems IF you have added custom programming to either functions.php or templates. If your only changes are CSS related, then that won't cause this type of problem in most situations.
Genesis child themes are always upgraded manually. Ignoring the switch to HTML5 (which one has to enable via code in an older child theme), CSS changes you've made in a child theme won't impact upgrading Genesis. But if you've made programming changes (as the OP possibly did), you have to make sure to check your code to see if it's compatible with the latest version of Genesis and make appropriate changes. The changes are very small, as in a function name that changes.
Another problem can arise if you update a very old version of the Genesis framework and you have a very old version of a child theme, even one to which you only made CSS changes. That's because the functions.php that came with the child theme might contain now outdated functions that will break your site.
Genesis usually deprecates the old approach and adds a new approach. It doesn't just remove the old approach in 1 step. By that, I mean it keeps the old approach so your site doesn't break and marks it as deprecated, and simultaneously adds the new approach so you can switch to it. The deprecated approach won't exist forever; it normally exists for a few major versions. That gives you some time to identify what has been deprecated and fix it. The OP's problem was likely caused by using an approach that became deprecated and then not updating Genesis or the child theme for a period of time and replacing those deprecated functions/filters.
Admittedly, it's can be a bit of work to identify what has been deprecated, but fortunately there are plenty of resources to help. We do managed WP hosting, and we have a development network where the WP_DEBUG constant is turned on. This causes the use of deprecated functions to be reported in the dashboard, so we can learn if code has been deprecated and fix it. WP_DEBUG is not something you'd want to use on a live site, so for an operator of even multiple sites or for someone that focuses on design, this is extra work, because you have to an environment similar to your live environment that is only used for testing. That's just another reason why we're big fans of managed WP hosting that do this sort of checking/testing 🙂
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
June 30, 2013 at 12:12 pm #48560echofoxtrotMemberBill,
I keep my Genesis framework up to date, and afaik am using only the latest child themes. I therefore wouldn't anticipate a problem. Now, suppose a child theme is upgraded - the upgrade would overwrite my custom css and php, if any. (This would be for anything other than Prose.)Therefore, prior to upgrading, I have to copy and save that custom css (added to the bottom of the child theme's style.css file) and any php I had added to the child theme's function.php file, and then add it back to the upgraded child themes style and function files.
Is that correct?
June 30, 2013 at 12:41 pm #48562Bill MurrayMemberEssentially, yes, that's correct, provided that it's clear that child themes aren't updated automatically.
Child themes are upgraded manually, whereas the Genesis framework can be updated automatically.
All of the steps you outlined are manual steps. There are ways to eliminate those steps, so that you can completely overwrite a child theme and NOT lose your customizations. For example, you could choose to never modify your child theme's functions.php and put all custom code in a custom functionality plugin. Your plugin might need to be updated if the child theme changed, though, but the changes would be the same as if you had the code in a modified functions.php. You can also leave the original theme style sheet unmodified and load a second style sheet that essentially changes only those elements you want to change. This method makes it much easier to take advantage of child theme upgrades, whereas the method you described gets to the same end point with much more work.
As for anticipating a problem, let's imagine you use the latest version of a SP theme but that theme is never upgraded from this point forward. In other words, you are always using the latest version of that child theme. If the child theme's functions.php uses hook names that have changed in Genesis 2.0 but are deprecated, you will have a problem in the future even though you are using the latest version of the child theme, because at some point those deprecated hooks will be removed. Therefore, even though at that future point you are using the latest version of Genesis and the latest version of your child theme, that child theme is old and dependent on deprecated hooks that will get removed. At that point, you will have a problem.
You can't take an old child theme, even though it is the latest version of that child theme, and expect it to work indefinitely into the future. At some future point (usually measured in years after original release), it will break because WP and Genesis are evolving and not standing still.
Web: https://wpperform.com or Twitter: @wpperform
We do managed WordPress hosting.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.