Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#41536 closed defect (bug) (invalid)

Text widgets don't show editor anymore, only expand to show delete/close options

Reported by: sseepuri's profile sseepuri Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Widgets Keywords: reporter-feedback
Focuses: Cc:

Description

We're on wordpress 4.8 and are seeing this issue where if we go to Appearance --> Widgets, we are not able to edit any of our existing text widgets. They all expand to show the delete/close buttons, but no text editor (see screenshot - https://ibb.co/hkof75). I do notice errors in the dev console when navigating to the widgets page (see screenshot - https://ibb.co/nmUWEk).

Attachments (1)

extended-text-widget-without-fields.png (55.1 KB) - added by westonruter 7 years ago.

Download all attachments as: .zip

Change History (12)

This ticket was mentioned in Slack in #core-customize by melchoyce. View the logs.


7 years ago

#2 follow-up: @westonruter
7 years ago

  • Keywords reporter-feedback added

@sseepuri Hi there. Have you tried 4.8.1-RC? It may be resolved with the work done on #41021. Nevertheless, the error messages you've helpfully shared don't seem to indicate that being the case.

What plugins do you have active?

#3 in reply to: ↑ 2 @sseepuri
7 years ago

@westonruter I've the following plugins active:
AddToAny Share Buttons
Advanced Category Excluder
Advanced Category Excluder Widgets
Advanced post slider
Akismet Anti-Spam
Amazon Web Services
amr shortcode any widget
Autoptimize
Better Font Awesome
Flexible Posts Widget
Greenhouse Job Board (custom, built on top of 1.6.0)
Hello Dolly
Latest Tweets Widget
MailChimp for WordPress
MailChimp for WordPress - Premium
Our Team Showcase
Q and A
Search Exclude
SEO Plugin for Metromile.com
WordPress Importer
WP Migrate DB Pro
WP Migrate DB Pro Media Files
WP Nivo Slider
WP Offload S3
WP Offload S3 - Assets Addon
Yoast SEO

I turned them all off and tried the widgets, and I'm getting the same error - it's what was mentioned in #41021 - the tinyMCE editor is missing. I haven't tried 4.8.1-RC, I'll try it locally and update here in some time

Replying to westonruter:

@sseepuri Hi there. Have you tried 4.8.1-RC? It may be resolved with the work done on #41021. Nevertheless, the error messages you've helpfully shared don't seem to indicate that being the case.

What plugins do you have active?

#4 @westonruter
7 years ago

@sseepuri ok, so the error still happens when all plugins are deactivated. What about your theme? What theme do you have active and does the error still happen when you switch to a core-bundled theme like Twenty Seventeen?

Thank you for your assistance with troubleshooting.

#5 follow-up: @sseepuri
7 years ago

@westonruter - I switched to Twenty Seventeen and it got rid of the errors and the text widget now shows the tinyMCE editor. But the existing widgets all lost the text that was in the widgets earlier. Also, some of the sidebars being used in our custom theme became inactive when I switched to 2017, but when I switched back they're still inactive. Is that a known behavior?

But I tried the nightly wp release locally and it fixes the issue using our custom theme (I still see those errors in the dev console, but the text widget now works fine with the tinyMCE editor). So I guess I'll just wait for the next release - when is that going out?

#6 in reply to: ↑ 5 @westonruter
7 years ago

Replying to sseepuri:

@westonruter - I switched to Twenty Seventeen and it got rid of the errors and the text widget now shows the tinyMCE editor. But the existing widgets all lost the text that was in the widgets earlier. Also, some of the sidebars being used in our custom theme became inactive when I switched to 2017, but when I switched back they're still inactive. Is that a known behavior?

The widgets assigned to a sidebar are essentially tied to the active theme. When you switch to a different theme, the widget configuration for a theme is saved for the old theme so that when you restore the theme the previous widget configuration is restored. So you should see the widgets with the text you were expecting placed under Inactive Widgets. This experience is slated to be improved as part of #39693.

But I tried the nightly wp release locally and it fixes the issue using our custom theme (I still see those errors in the dev console, but the text widget now works fine with the tinyMCE editor). So I guess I'll just wait for the next release - when is that going out?

The WordPress 4.8.1 release was just pushed out today. I don't think the changes in this release will resolve the issue you are having, however. But it would be helpful to confirm on a test environment.

If you can send me your custom theme on WordPress Slack that would help me to diagnose what is causing the problem. Otherwise, you can email me a ZIP of the files over email via temp-trac-wp-core-41536@xwp.co.

#7 @westonruter
7 years ago

  • Milestone changed from Awaiting Review to 4.8.2

I was able to reproduce this problem with another plugin that extends the Text widget.

@sseepuri do you have a plugin that modifies the Text widget? I'll look through the plugins you've supplied to confirm, but you may have a quicker answer.

#8 @westonruter
7 years ago

In short, I discovered that the JS for the rich Text widget is not accounting for widgets that extend WP_Widget_Text, and give the extended widgets different ID bases. When a widget extends the Text widget in this way, it shows without the editor.

An easy way to reproduce this is to add a plugin (drop the following into mu-plugins) that does:

<?php
require_once ABSPATH . '/wp-includes/widgets/class-wp-widget-text.php';

class Extended_Text_Widget extends WP_Widget_Text {
        function __construct() {
                parent::__construct();
                $this->id_base = 'extended_text';
                $this->name = __( 'Extended Text' );
                $this->option_name = 'widget_' . $this->id_base;
                $this->widget_options['description'] = __( 'Extended arbitrary text.' );
                $this->control_options['id_base'] = $this->id_base;
        }
}

add_action( 'widgets_init', function() {
        register_widget( 'Extended_Text_Widget' );
} );

#9 @westonruter
7 years ago

But then again, I don't recall there being any JS errors in the console.

#10 @sseepuri
7 years ago

@westonruter - updating wp to 4.8.1 did indeed fix the issue I was seeing - the text widgets work fine now. We don't have a widget that modifies the text widget, we use 'amr shortcode any widget' that creates a shortcode for the text widget, not sure if that's considered modifying.

In any case, the issue we're having is now resolved with 4.8.1. Thank you for taking the time and helping with this.

#11 @westonruter
7 years ago

  • Milestone 4.8.2 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Excellent. Thank you!

Note: See TracTickets for help on using tickets.