Where can we see the website in question?
Note, I cannot provide a login. However, I’m a developer with full cPanel access. Feel free to provide instructions, and I’ll report whatever details needed (redacting security information, of course).
What other plugins and theme do you use on the site?
The major plugins the site uses include WooCommerce, some of the EventON plugins, and some of the Sabai directory listing plugins. The theme is Divi.
I’m willing to provide a full list with version information, but not publically. If you’d like more detail, let me know how I can send a PM.
I’ll do a little digging in the meantime, and try to track down the point of failure.
Update:
I added some logs, and determined that the menu registration code is reached:
https://github.com/rocklobster-in/contact-form-7/blob/trunk/admin/admin.php#L54
However, the menu renderer is not getting reached when visiting the editor page:
https://github.com/rocklobster-in/contact-form-7/blob/trunk/admin/admin.php#L465
For clarity, the form list page does load (?page=wpcf7).
But not a single form edit page (?page=wpcf7&post=…&action=edit).
I also tried replacing the wpcf7_read_contact_forms capability requirement with manage_options to see if it was a capability issue, but that didn’t fix it either.
I found the issue:
I discovered that, when ‘post’ appears as a parameter in the query string, the page has a different parent:
- When ‘post’ is absent, the parent page is
admin.php – which is correct.
- But, when ‘post’ is present, the parent page suddenly becomes
admin.php?post_type=wpcf7_contact_form
This switch, of course, causes get_plugin_page_hookname to generate the wrong hookname for the registered submenu page:
Instead of contact_page_wpcf7, which is returned by the add_submenu_page call, it gets admin_page_wpcf7, which of course doesn’t exist.
To be clear, I’m not sure where this behavior comes from, whether WP or a plugin or theme. What I can say, though, is that, if I change the query variable name to something other than ‘post’ here, it works:
https://github.com/rocklobster-in/contact-form-7/blob/trunk/admin/admin.php#L441
I will check to find the source of this behavior.
Thanks
Yep. I’ve confirmed this is a bug due to the EventON plugin, which screws with global $typenow variable. It has the following code snippet (and variants) copied all over the codebase:
if ( $typenow == 'post' && ! empty( $_GET['post'] ) ) {
$typenow = $post->post_type;
} elseif ( empty( $typenow ) && ! empty( $_GET['post'] ) ) { // <---
$post = get_post( $_GET['post'] );
$typenow = $post->post_type; // <---
}
As horrific as the EventON plugin code is… is this something you’d be willing to fix on your end?