[Plugin: Posts 2 Posts] get_current_screen error on 1.4.1, Ajax delete not working on 1.4.2-alpha2
-
This is a transfer from another thread.
I’m getting a strange error – which seems to be isolated to a single (local) install with a custom theme. I’m fully prepared to fix my code, I’m just not sure where to begin.
WP 3.4.1
P2P 1.4.2-alpha2 (also happened with 1.4.1, but not previous versions)Upon activation, I get a fatal error:
Call to undefined function get_current_screen() in [localpath]/wp-content/plugins/posts-to-posts/core/url-query.php on line 27
I deactivated all other plugins, same error. I did try this with a different install (one that has no P2P connections yet), and there was no problem.
Temporarily commenting out the following lines seemed to fix the problem (lines 12-13 in posts-to-posts/core/url-query.php):
if ( is_admin() )
add_action( ‘pre_user_query’, array( __CLASS__, ‘user_query’ ), 9 );But I really would rather ensure the problem won’t crop up again once we upgrade. I know not knowing specifics about my install will make it difficult to diagnose, but I’m crawling line by line through any P2P code and I can’t figure out what would trigger that error – so I’m hoping that it might be caused by something obvious (an action hooked too early?) that changed in the most recent version.
Thanks!
UPDATE 9-7-12
I have confirmed that whatever was causing the “get_current_screen not found” error does NOT happen with 1.4.2-alpha2. Upgrading to the alpha resolves that issue, and downgrading to 1.4.1 brings it back.I’m fine to sit on 1.4.2-alpha2 until 1.4.2 is released – but now I’m experiencing different bad behavior: when I try to delete all connections to a post in the post edit screen (by clicking on the trash icon at the top of the connected posts list and confirming) – the connections do not seem to be deleted: the javascript callback fires, removing the connected posts list on the screen, but upon reloading the edit page or saving/updating the post, the connected posts reappear: it seems the connections are still in the DB after the Ajax call.
I’m once again fully willing to believe the custom theme functions I’m writing for this particular installation might be having an effect, but I had no problems prior to 1.4.1, and I’m not getting any helpful notices from WP_DEBUG or javascript consoles. I’m hoping the description above might help narrow down the problem so I can squash the bug, wherever it may lay. Thoughts?
- The topic ‘[Plugin: Posts 2 Posts] get_current_screen error on 1.4.1, Ajax delete not working on 1.4.2-alpha2’ is closed to new replies.