#17874 closed defect (bug) (fixed)
Warning if TinyMCE isn't used for posts
Reported by: | SidHarrell | Owned by: | azaozz |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | trivial | Version: | 3.2 |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description
Notice: Trying to get property of non-object in /home/sidney/www/wordpress_trunk/wp-admin/includes/post.php on line 1760
Attachments (1)
Change History (14)
#4
@
13 years ago
I'm a (new) developer working on the Event Espresso plugin, so I have EE trunk installed. I was going through suppressing php warnings coming from EE when I found this.
@ Mr. Nacin
Does that mean we are doing something to unset that field of the global. I will check it out and get back to you. Thanks for your time.
#5
@
13 years ago
I've been killing myself trying to figure out where Event Espresso would be setting the global $post to NULL (what is it at the breakpoint I set on line 1760) There is only one file where we use the global $post, and I set breakpoints at the three spots in that file where it's declared, and when it didn't hit any of them, I renamed the file and no effect. So I declared global $post at the top of admin.php so I could watch it (I tried setting a watch on it first) and it never gets set to anything (stays NULL) throughout execution. I'm going to the plugin settings page, so it's http://localhost/wordpress_trunk/wp-admin/admin.php?page=event_espresso
When I go to another plugin settings page that doesn't give the notice, it's because it never gets to post.php line 1760.
Here's the call stack on the notice. Note the event espresso is calling wp_tiny_mce() in /wp-admin/includes/post.php:1711
Call Stack: 0.0120 681896
- {main}() /var/www/wordpress_trunk/wp-admin/index.php:0 0.0134 812712
- require_once('/var/www/wordpress_trunk/wp-admin/admin.php') /var/www/wordpress_trunk/wp-admin/index.php:10 0.4190 40215840
- do_action() /var/www/wordpress_trunk/wp-admin/admin.php:155 0.4191 40218040
- call_user_func_array() /var/www/wordpress_trunk/wp-includes/plugin.php:405 0.4191 40218096
- organization_config_mnu() /var/www/wordpress_trunk/wp-includes/plugin.php:0 0.4191 40218768
- wp_tiny_mce() /var/www/wordpress_trunk/wp-content/plugins/event-espresso/includes/organization_config.php:8 0.4217 40241584
- do_action() /var/www/wordpress_trunk/wp-admin/includes/post.php:1711 0.4217 40243632
- call_user_func_array() /var/www/wordpress_trunk/wp-includes/plugin.php:405 0.4217 40243688
- wp_preload_dialogs() /var/www/wordpress_trunk/wp-includes/plugin.php:0 0.4314 40304264
- wp_fullscreen_html() /var/www/wordpress_trunk/wp-admin/includes/post.php:1732
#7
@
13 years ago
- Component changed from General to Editor
- Milestone changed from Awaiting Review to 3.2
- Summary changed from php warning to Warning if TinyMCE isn't used for posts
#8
@
13 years ago
So the problem is the new fullscreen mode. It has the "Save" button, but if you use wp_tiny_mce() outside the edit screen, for example for plugins like Event Espresso you will get the warning. We should disable the fullscreen mode then.
In your case wp_tiny_mce( $teeny = true ) would be better too.
#10
follow-up:
↓ 12
@
13 years ago
Sorry, the stack trace didn't show the arguments we're passing:
wp_tiny_mce( false , // true makes the editor "teeny" array( "editor_selector" => "theEditor"//This is the class name of your text field ) );}}}
#12
in reply to:
↑ 10
@
13 years ago
Replying to SidHarrell:
As @ocean90 points out above, it's probably better to use the 'teeny' mode of the editor (it doesn't include DFW).
my hackish attempt. How do the pros do it?