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

CMB2_Hookup.php not found #1333

Closed
galengidman opened this issue Jan 23, 2020 · 18 comments
Closed

CMB2_Hookup.php not found #1333

galengidman opened this issue Jan 23, 2020 · 18 comments

Comments

@galengidman
Copy link
Contributor

Describe the bug

On Pantheon servers (I assume due to server configuration) the following errors are displayed post-2.7 upgrade:

Warning: include_once(/srv/bindings/e9808ad72e3c4b1da56e9e2418c897d8/code/wp-content/plugins/cmb2/includes/CMB2_Hookup.php): failed to open stream: No such file or directory in /srv/bindings/e9808ad72e3c4b1da56e9e2418c897d8/code/wp-content/plugins/cmb2/includes/helper-functions.php on line 44

Warning: include_once(): Failed opening '/srv/bindings/e9808ad72e3c4b1da56e9e2418c897d8/code/wp-content/plugins/cmb2/includes/CMB2_Hookup.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /srv/bindings/e9808ad72e3c4b1da56e9e2418c897d8/code/wp-content/plugins/cmb2/includes/helper-functions.php on line 44

Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'CMB2_Hookup' not found in /srv/bindings/e9808ad72e3c4b1da56e9e2418c897d8/code/wp-includes/class-wp-hook.php on line 288

Steps to reproduce (I have confirmed I can reproduce this issue on the develop branch):

  1. Sign up for free pantheon.io account and create sandbox site.
  2. Install CMB2 and see above errors.

Possible Solution

Appears to be due to #1328 changing the name of the class but not the name of the file itself. Expect changing CMB2_hookup.phpCMB2_Hookup.php would fix.

Your Environment

Works = MacOS Valet + Homebrew PHP 7.3.
Broken = Pantheon.

@jtsternberg
Copy link
Member

Well, oops. Yes the file name itself should have been renamed. I’ll get a hot fix pushed tomorrow.

@jtsternberg
Copy link
Member

Hmm interesting. the file-name is correct here. I need to look into svn to see if it doesn't properly register the file-name case.

@galengidman
Copy link
Contributor Author

Weird. It looks correct in .org SVN too. I wonder if something funky happened when I ran the upgrade on my end?

@galengidman
Copy link
Contributor Author

Figured it out.

https://stackoverflow.com/questions/17683458/how-do-i-commit-case-sensitive-only-filename-changes-in-git

Pantheon's workflow is Git-based, so when I updated the plugin and committed the change Git didn't view the filename change as a new file and didn't add it to the commit.

@jtsternberg
Copy link
Member

Ah ok bummer. I did check the WP.org download and the file is properly cased. This is an unfortunate issue, but one I'm not sure we can really fix other than to put it back, and I'm not sure it's worth it. Hoping the developer-savvy audience that this may occur for will know well enough to find the issue, or to find this thread.

@galengidman
Copy link
Contributor Author

Makes sense. At least now we have this thread for reference. Thanks for the hard work!

@jonathanstegall
Copy link
Contributor

On WordPress.com VIP Go hosting, I also ran into this issue upgrading 2.6.0 to 2.7.0. Automattic's workflow is probably similar to Pantheon's.

Am I reading correctly that the fix is to delete the file and then re-add it, so that Git will realize that it is a change and commit it as such?

@tw2113
Copy link
Contributor

tw2113 commented Jan 27, 2020

Yes, I believe so.

@damonsharp
Copy link

I just followed this from @galengidman above. Works to get Git to recognize file change. No need to delete and re-add: #1333 (comment)

@jonathanstegall
Copy link
Contributor

@damonsharp it kind of looks like I can do git config core.ignorecase false and that would be sufficient? Or did you find that you had to do things from the other answers on that question?

@galengidman
Copy link
Contributor Author

@jonathanstegall For me just running git config core.ignorecase false was sufficient for Git to recognize the file name change and allow me to add it to a new commit.

@damonsharp
Copy link

@jonathanstegall I initially ran git mv -f OldFileNameCase newfilenamecase in my case, but adding it as a config is better.

@jonathanstegall
Copy link
Contributor

I find that git config core.ignorecase false keeps both the lowercase and the uppercase file. Which is fine, I imagine. But presumably using git mv would've prevented this.

JiveDig pushed a commit to maithemewp/mai-theme-engine that referenced this issue Feb 3, 2020
Not sure how this happened to us, but making the file name correct should fix customer issues. Re CMB2/CMB2#1333
@JiveDig
Copy link

JiveDig commented Feb 3, 2020

Hit this issue as well. CMB2 in my plugin didn't commit the file case change, but git mv -f OldFileNameCase newfilenamecase worked for me. Thank you all for the solution(s). 👍

@tw2113 tw2113 closed this as completed Sep 25, 2020
@chrilleferna
Copy link

This is really a nasty issue. I spent 6 hours yesterday to try to find out why metboxes worked in my dev environment on OSX but not in production at OVH. It turned out that CMB2_Hookup.php was still named CMB2_hookup.php. This did not break things on OSX with PHP 7.2 but it did on the OVH server with PHP 7.3. Renaming fixed the problem.

I don't know why my file used the old spelling. Maybe because my dev environement is under git?

It's annoying when this kind of problem only occurs in the production environment, and I suspect that other people may run into the same problem.

Couldn't this particular issue, which is due to the unfortunate old naming of the class file, be resolved in helper-functions/cmb2_autoload_classes?

@jtsternberg
Copy link
Member

@chrilleferna we may be able to put a shim in there to make sure it finds the old file, but it's not something I can easily test, as I don't have that issue on my file-system. Would you be willing to test this theory on your server?

@chrilleferna
Copy link

Yes, I would be happy to test!

@mark-barnes-sp
Copy link

I just had the same problem today with my git workflow, so a shim might be good for others, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants