WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#52556 new defect (bug)

WordPress is adding   always

Reported by: snuffybg Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6.1
Component: Editor Keywords: reporter-feedback
Focuses: javascript, administration Cc:

Description

Hello,
This bug is happening only if gutenberg editor is disabled.
Ill try to explain in best way how wordpress is adding this &nbsp.

  1. Create a new page

1.1 Type a title or without both give same result.
1.2 In content there should be nothing
1.3 Publish

  1. After publish try to leave the page editing lest say clicking on dashboard from the menu.

Wordpress will promp asking to save changes.
If you are in visual editor and swap to text editor you will notice that   was added.

  1. If you click update everytime wordpress will add a new  

In inspector i have notice this script

<script type="text/javascript">
            addLoadEvent = function(func) {
                if (typeof jQuery !== 'undefined')
                    jQuery(document).ready(func);
                else if (typeof wpOnload !== 'function') {
                    wpOnload = func;
                } else {
                    var oldonload = wpOnload;
                    wpOnload = function() {
                        oldonload();
                        func();
                    }
                }
            }
            ;
            var ajaxurl = '/luxdigital/wp-admin/admin-ajax.php'
              , pagenow = 'page'
              , typenow = 'page'
              , adminpage = 'post-php'
              , thousandsSeparator = '&nbsp;'
              , decimalPoint = ','
              , isRtl = 0;
        </script>

If i put a breakpoint and reload the page will return thousandsSeparator undefined
I dont know much about this function and the idea behind it but any ideas how to prevent this would be great.

Change History (5)

#1 @sabernhardt
5 months ago

  • Component changed from General to Editor
  • Keywords reporter-feedback added

@snuffybg Hi and thanks for the report!

I was unable to reproduce the error in English or Hungarian, but perhaps someone else could.

Please tell us which language and WordPress version you use. If you have 5.6.1, the issue might be related to #52440, yet it probably involves more than the save prompt.

The editor normally adds &nbsp; in the Text view if the Visual had an empty paragraph, so I don't think it's related to the thousands separator. However, if it is related to the number_format_thousands_sep value, these languages have &nbsp; (or &amp;nbsp;):

  • Hungarian (Magyar)
  • Norwegian-Bokmål (Norsk bokmål)
  • Norwegian-Nynorsk (Norsk nynorsk)
  • Occitan
  • Swedish (Svenska)
Last edited 5 months ago by sabernhardt (previous) (diff)

#2 @snuffybg
5 months ago

Hi,
I have installed a completly new wp installation on Bulgarian language.
PHP version 7.4
Wordpress version 5.6.1
With default theme Twenty Twenty-One version: 1.1
If worth mentioning i am using Softaculous in my cPanel to do installation but i dont think there is any relation to that problem but still...

The only plugin installed there is mine where i have the following codes:

  • wp_password_change_notification - disabled to notify me for password changes.
  • add_filter( 'use_block_editor_for_post', '__return_false' ); - disable gutenberg.
  • remove_filter('the_content', 'wpautop'); removing auto paragraph.

I am attaching 2 screenshots
Image1: https://prnt.sc/zz0t8y
Image2: https://prnt.sc/zz0sh0

1st image is clicking on add new page without moving or clicking anywere. The content is colored green bg for some reason (maybe the theme does that).

2nd image is when i swap from visual to text editor. I know swaping is adding &nbsp; and that is somewhat fine but as you can see there 2 &nbsp;

The bug is only if you update on visual editor. If i keep clicking update button will keep adding eachtime 1 &nbsp;

Other thing i notice is that is counting &nbsp; as words you can see at the bottom left corner of the editor the count in image1. If you swap between the visual and the text editor the count will reset to 0 (see image2).

I will make a clean english install too and test and i think there wont be any change.

Last edited 5 months ago by SergeyBiryukov (previous) (diff)

#3 @snuffybg
5 months ago

The same result is with english version.
I did additional test and this is happening only on 5.6.1 version. I did downgrade to 5.6 and this is not happening.

#4 @sabernhardt
5 months ago

  • Version set to 5.6.1

If this only occurs with 5.6.1, and it happens in English too, I think it's probably related to #52440 then. That issue will be fixed in next week's 5.6.2 version, and please confirm whether it fixes this as well.

If one of those installations is not public and you want to confirm before Tuesday, you could try the Beta Tester plugin (with the "Point release" setting).

(And yes, the green background should be a theme style.)

#5 @snuffybg
5 months ago

Hello the promp after update is gone, BUT now if i use visual editor like wpbakery for example and do a change, and click to leave without saving it, the promp its not triggered. Where i can see what exactly was changed in 5.6.2 update ? Its kinda frustrating to jump from core to plugin forums to fix something that was working in 5.6.0 ..... Currently i cant point a bug for 5.6.2 so i am typing here.

Last edited 5 months ago by snuffybg (previous) (diff)
Note: See TracTickets for help on using tickets.