WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 6 weeks ago

#53770 closed defect (bug) (invalid)

Site logo missing in 5.8

Reported by: eqwmo Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.8
Component: Customize Keywords: has-testing-info reporter-feedback close
Focuses: Cc:

Description

Hi, the site logo no longer appears after upgrading to 5.8. The image is missing from the generated DOM. This occurs on all pages. This logo is found at Appearance > Customize. Tried re-uploading the logo, makes no difference. I have only tested this with the Goran theme. Other themes including default may be impacted, this would require testing. Due to the theme age and the fact that it worked fine up to WP 5.7.x, this is not a theme issue this is a wordpress v5.8 issue. Thanks.

Attachments (1)

53770-reproduce-test1.gif (3.6 MB) - added by hellofromTonya 2 months ago.
Reproduce test report: with Goran theme, site logo, upgrading from WP 5.7.2 to 5.8

Change History (21)

#1 @jokanane
2 months ago

I'm seeing either the same issue or something similar.

From what I've found out, the return value of

get_theme_mod('custom_logo')

has changed from int to array that holds an ID and sizes array.

It is however odd to me that WP 5.8 returns a different ID than WP cores up to 5.7.2. I can clearly see that in my case WP 5.7.2 returns ID 4451 (int), whereas WP 5.8 returns ID 24 (in the array), which is for another site logo image, apparently for one that's been set as site logo a long time ago.

Is all this intended?

#2 @jokanane
2 months ago

In another project, I'm seeing that the aforementioned return value changes from int 48 to string '48'.

I don't know what's going on, but things don't seem consistent between 5.7.2 and 5.8.

@hellofromTonya
2 months ago

Reproduce test report: with Goran theme, site logo, upgrading from WP 5.7.2 to 5.8

#3 @hellofromTonya
2 months ago

Test Report

Testing Environment

  • WordPress: started with 5.7.2 and upgraded to 5.8
  • All activated plugins: Jetpack (needed to add the site logo field)
  • Theme: Goran
  • Localhost: Local running on nginx, PHP 7.3.5, MySQL 8.0.16
  • OS: macOS Big Sur v 11.5
  • Browser: Chrome v 92.0.4515.107, Firefox v 90.0.2 (64-bit), and Safari v 14.1.2

Testing Steps

  • Started with WordPress 5.7.2
  • Installed and activated the Goran theme
  • Installed and activated Jetpack plugin
  • Added a logo to Appearance > Customize > Site Identity > Logo
  • Clicked the Publish button. Results: logo appears in Customizer and on the front-end
  • Upgraded to WordPress 5.8.0 by going to Dashboard > Updates and then clicking the Update now button
  • Go to Customizer to check that the logo appears in the settings and rendering in the frame, i.e. Appearance > Customize > Site Identity. Result: logo appears as expected.
  • Refresh the front-end. Result: logo appears as expected.

Testing Results

Unable to reproduce the problem. Logo appears in both WordPress 5.7.2 and 5.8.

#4 @hellofromTonya
2 months ago

  • Keywords reporter-feedback close added

Hello @eqwmo,

Welcome to WordPress Core Trac!

I'm sorry your site's logo is not appearing after upgrading to WordPress 5.8.

I was not able to reproduce the problem when using the Goran theme with Jetpack and then upgrading from WordPress 5.7.2 to 5.8 (see my Testing Report and 53770-reproduce-test1.gif).

I suspect the problem is a plugin conflict. To verify, please try the following and share your findings:

  • If the logo appears in Customizer area but not on the front end, then it may be an overly aggressive cache. Follow these steps:
    • Flush any caching plugins you might be running, as well as server and/or browser caches. Not just your browser, but any op cache or content network cache as well such as Cloudflare. That will solve many weird JavaScript issues.
    • Flush Managed host caches. Managed WP hosting often has special caches. If your host has a “Purge Varnish” or “Flush Memcache” tool, try that. You can ask your provider to flush memcache and Varnish for you if necessary.
  • Disable all plugins expect Jetpack.
  • Go to Appearance > Customize > Site Identity. Does the site logo appear?
    • If yes, then one of the plugins you deactivated is likely conflicting. Please reactivate each plugin one-at-a-time and until the logo disappears again. Then note which plugin it is in this ticket.
    • If no, go to the next step.
  • Check if there are any browser errors. Steps are here in this support article. If yes, please make a screenshare and add it to this ticket.

Troubleshooting help is also provided here in the Support forums.

#5 follow-up: @eqwmo
2 months ago

  • Keywords reporter-feedback close removed

Thanks @hellofromTonya.

Results in relation to your information:

  1. Logo indeed appears in Customizer area (settings prefpane, but not site preview pane), but does not show on the site.
  2. Cleared all caches and retested, issue remains. (Details: Flushed browser cache and cookies, purged varnish, flushed memcache, cleared site page cache, cleared minified JS and CSS files, no CDN or RP is in use).
  3. No plugins have changed since the upgrade to WP 5.8. If it is caused by a plugin conflict, it is new with 5.8 and caused by the core upgrade not the plugin. There are no plugins that would remove the logo element from the generated HTML prior to generating or serving the page. The issue is that 5.8 and/or Jetpack is not generating that element. (Note: the site-branding"container div is generated, it should contain two visual items being the site-logo and site-name, the site-logo is missing from the DOM but the site-name is being generated just fine).
  4. There are no browser errors.

Interestingly, could the issues discovered by @jokanane be contributing? If get_theme_mod('custom_logo') is returning something different in 5.8 to what it used to in the previous version, there could be a big chance that this could be the cause of my issue too.

Thanks.

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


2 months ago

This ticket was mentioned in Slack in #core-test by hellofromtonya. View the logs.


2 months ago

#8 @hellofromTonya
2 months ago

  • Keywords has-testing-info added

Testing Info to Reproduce

Testing env:

  • Activate the Core Rollback plugin (helps to rollback back the version after upgrading to 5.8)
  • Activate the Goran theme
  • Activate Jetpack plugin

Testing steps:

  1. Started with WordPress 5.7.2
  2. Installed and activated the Goran theme
  3. Installed and activated Jetpack plugin
  4. Added a logo to Appearance > Customize > Site Identity > Logo
  5. Clicked the Publish button.
  6. Check if the logo appears in the field, renders in the Customizer previewer, and renders on the front-end.
  7. Upgrade to WordPress 5.8.0 by going to Dashboard > Updates and then clicking the Update now button
  8. Go to Appearance > Customize > Site Identity > Logo and recheck that the logo appears in the settings field, Customizer preview, and front-end.

This ticket was mentioned in Slack in #core-test by boniu91. View the logs.


2 months ago

#10 @jokanane
2 months ago

I installed fresh 5.7.2 and 5.8 side-by-side, no other plugins than what the core installs, default theme 2021.

I then uploaded and set the site logo file in both identically and set..:

<?php var_dump(get_theme_mod('custom_logo')); ?>

... in header.php.

5.7.2 returns int(10) and 5.8 string(2) "10". This alone is surprising and makes one wonder if there's another regression around here that's causing the problems we're seeing.

@eqwmo if you know how, do the var_dump() given above with your site having 5.7.2 and then with 5.8. I expect you to see an integer with 5.7.2 and an array with 5.8. That will throw off the code that is set to render the image.

Last edited 2 months ago by jokanane (previous) (diff)

#11 @jokanane
2 months ago

It is however odd to me that WP 5.8 returns a different ID than WP cores up to 5.7.2. I can clearly see that in my case WP 5.7.2 returns ID 4451 (int), whereas WP 5.8 returns ID 24 (in the array), which is for another site logo image, apparently for one that's been set as site logo a long time ago.

I looked into the database. With WP 5.8, the custom_logo returned is from another theme's theme_mods_ in the options table. How is this possible?

#12 @jeroenrotty
2 months ago

Hi!

I've tested this together with @hellofromTonya and these are my findings:

  • The logo always shows on the front-end for me on both WP 5.7.2 and 5.8.
  • When you remove the logo, hit save. The logo gets removed in the preview and on the front-end.
  • When you set a logo again. See that the preview isn't showing the new image BUT it does show it on the front-end of the site after you saved your changes.

Exactly the same happens with its parent theme Edin. Looking at the theme header.php, it just calls the jetpack_the_site_logo function in Jetpack. And looking at the most recent Jetpack release, they seem to have changed some stuff for the Site logo as per their changelog (Site Logo: improve compatibility with WordPress 5.8's new Site Logo block.)

#13 @hellofromTonya
2 months ago

Test Report 2

The test team worked live on this today during live stream.

Testing Environment

WordPress: 5.7.2 and 5.8.0
All activated plugins: Jetpack (needed to add the site logo field)
Theme: Goran
Localhost: Local running on nginx, PHP 7.3.5, MySQL 8.0.16
OS: macOS Big Sur v 11.5
Browser: Chrome v 92.0.4515.107

Testing Steps

  • Add a logo to Appearance > Customize > Site Identity > Logo
  • Click the Publish button.
  • Check if the logo renders in the logo field, Customizer previewer, and front-end. Results: Yes, rendered in all 3 ✅
  • Check the site_logo option in the wp_options database table. Results: ✅
  • Click Remove logo button.
  • Click the Publish button.
  • Recheck rendering. Results: Logo is gone in all 3 places ✅
  • Check the site_logo option in the wp_options database table. Results: ID = 0 ✅
  • Add a different logo.
  • Click the Publish button.
  • Recheck rendering. Results: Logo does not render in Customizer previewer ❌ but does render in the field and front-end
  • Check the site_logo option in the wp_options database table. Results: ✅
  • Switch to 5.8.0
  • Retest. Results: Same results as on WP 5.7.2
  • Switch to Twenty Twenty-One theme.
  • Retest. Results: Rendering correctly ✅ and could not reproduce problems seen above with Goran
  • Check the theme_mods_twentytwentyone option in the wp_options database table. Results: custom_logo was correctly updated ✅
  • Upgrade to WP 5.7.2
  • Retest. Results: Rendering correctly ✅
  • Check the theme_mods_twentytwentyone option in the wp_options database table. Results: custom_logo was correctly updated ✅
  • Switch to Twenty Twenty theme.
  • Retest. Results: Rendering correctly ✅ and could not reproduce problems seen above with Goran
  • Check the theme_mods_twentytwenty option in the wp_options database table. Results: custom_logo was correctly updated ✅
  • Upgrade to WP 5.8.0
  • Retest. Results: Rendering correctly ✅
  • Check the theme_mods_twentytwenty option in the wp_options database table. Results: custom_logo was correctly updated ✅
  • In all tests, there were no browser console errors or server side errors.

Testing Results

  • ❌ Able to reproduce logo not appearing in the Customizer previewer with Goran + Jetpack
    • ✅ Happens on both WordPress 5.7.2 and 5.8.0
    • ✅ Logo renders correctly in the settings field and on the front-end
    • ✅ Logo properly updates in the site_option option in the database
  • ✅ Not able reproduce the problem with Twenty Twenty or Twenty Twenty-One themes with and without Jetpack. These themes use their own theme mod and not the site_logo option.
  • ✅ No browser console errors
  • ✅ No server side errors (error.log is empty)

Testing Observations

  • ✅ Does not appear to be a WordPress 5.8 problem as it happens on 5.7.2 too.
  • 👉 Likely suspect causing it: Jetpack plugin

Goran uses Jetpack for the site logo. In the theme's header.php file, it's using edin_the_site_logo() from Jetpack:

<div class="site-branding">
        <?php edin_the_site_logo(); ?>
        <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
        <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</div><!-- .site-branding -->

#14 @hellofromTonya
2 months ago

The Test Team was able to reproduce the problem of not rendering in the Customizer previewer. However, this happened with WordPress 5.7.2 and 5.8.0 with the Goran theme and Jetpack. We were not able to reproduce the problem with Twenty Twenty or Twenty Twenty-One themes with and without Jetpack.

Suspect there is an issue with Jetpack rendering the logo in the Customizer previewer. This needs to be reported and tracked upstream in the Jetpack GitHub repository or through their support page https://wordpress.org/support/plugin/jetpack/.

#15 in reply to: ↑ 5 @hellofromTonya
2 months ago

  • Keywords reporter-feedback added

Replying to eqwmo:

  1. No plugins have changed since the upgrade to WP 5.8. If it is caused by a plugin conflict, it is new with 5.8 and caused by the core upgrade not the plugin. There are no plugins that would remove the logo element from the generated HTML prior to generating or serving the page. The issue is that 5.8 and/or Jetpack is not generating that element. (Note: the site-branding"container div is generated, it should contain two visual items being the site-logo and site-name, the site-logo is missing from the DOM but the site-name is being generated just fine).

@eqwmo Though no other plugins were upgraded or added, a plugin can have a conflict with a new version of WordPress, a theme, or another plugin. We were able to reproduce the Customizer previewer not showing the logo but it did properly render on the front-end and saved in the database. Testing is only with Jetpack version 9.9.1 and Goran theme version 1.2.5. No other plugins were activated.

Deactivating all of your plugins, except for Jetpack, will help contributors and you to further investigate what could be causing the problem.

Interestingly, could the issues discovered by @jokanane be contributing? If get_theme_mod('custom_logo') is returning something different in 5.8 to what it used to in the previous version, there could be a big chance that this could be the cause of my issue too.

The Goran theme does not use or have a custom_logo mod in its theme_mods_goran option in the database:

a:5:{i:0;b:0;s:18:"nav_menu_locations";a:1:{s:7:"primary";i:2;}s:18:"custom_css_post_id";i:-1;s:16:"header_textcolor";s:6:"ffffff";s:16:"sidebars_widgets";a:2:{s:4:"time";i:1627414470;s:4:"data";a:8:{s:19:"wp_inactive_widgets";a:0:{}s:9:"sidebar-1";a:1:{i:0;s:13:"custom_html-2";}s:9:"sidebar-2";a:0:{}s:9:"sidebar-3";a:0:{}s:9:"sidebar-4";a:0:{}s:9:"sidebar-5";a:0:{}s:9:"sidebar-6";a:0:{}s:9:"sidebar-7";a:0:{}}}}

Rather, it uses Jetpack. Jetpack saves to the site_option in the database. When rendering, it checks if the current theme has a custom_logo mod (which Goran does not) and if no, it uses the site_logo option. In testing, the site_logo option updated correctly each time.

#16 follow-up: @hellofromTonya
2 months ago

Reference: #53247 [51091]

A change was made in WordPress 5.8 where _override_custom_logo_theme_mod is now registered to the custom_logo theme mod, i.e. filter theme_mod_custom_logo. In this callback, if the site_logo option exists, it is used instead of the custom_logo theme mod.

This filter fires when the function get_theme_mod() runs, such as when running:

get_theme_mod( 'custom_logo` );

For the Goran theme, this change does not affect it, as it's using the site_logo option and not the custom_logo theme mod.

What about other themes?

Let's examine Twenty Twenty One (TT1). It's using the_custom_logo(). The callstack:

the_custom_logo()
get_custom_logo()
get_theme_mod( 'custom_logo' )
apply_filter( 'theme_mod_custom_logo', ... )
_override_custom_logo_theme_mod()

This works fine _except_ for when:

  1. TT1 is active and Logo is set, i.e. meaning both the custom_logo theme mod and site_logo are both set to the same ID.
  2. Switch to a different theme.
  3. Change the logo, i.e. meaning the site_logo is different from before and the current theme's mod option for custom_logo is saved (but TT1's remains the old one).
  4. Switch back to the TT1 theme. The Logo rendered is not the one in TT1's custom_logo theme mod but is the one in the site_logo.

The options database values are correct, but running get_theme_mod( 'custom_logo' ) returns the site_logo option instead of the theme's mod.

This means once you set a site logo, it'll stay the same when switching between themes. Looking in the database could cause confusion. Not sure if this change is by design or an edge case. Needs investigation.

I looked into the database. With WP 5.8, the custom_logo returned is from another theme's theme_mods_ in the options table. How is this possible?

@jokanane I suspect this is what you're seeing when looking at the database in comparison to what is being rendered. Can you look at the site_logo option in the database and see if that is the logo ID that is being rendered?

Last edited 2 months ago by hellofromTonya (previous) (diff)

#17 in reply to: ↑ 16 @jokanane
2 months ago

First, thank you very much for your elaborative answer!

Replying to hellofromTonya:

@jokanane I suspect this is what you're seeing when looking at the database in comparison to what is being rendered. Can you look at the site_logo option in the database and see if that is the logo ID that is being rendered?

Yes, site_logo indeed has the ID 24 in the database.

I ran DELETE FROM wp_options WHERE option_name='site_logo'; and things appear to be back to normal.

A silly question out of curiosity, is there a way to reset site_logo via dashboard?

Ps. I didn't want to bring more details, possibly confusing, earlier as I suspected that these things are related, and yes they are: Customizer has failed to load with WP5.8 in the discussed project. Browser console had Uncaught SyntaxError: Unexpected token '<' at customize.php:5993. Now, when site_logo no longer interferes in the options table, also Customizer loads correctly.

#18 @hellofromTonya
2 months ago

In investigating this issue, an edge case was uncovered. Created a new ticket #53817 for this edge case. Note: This edge case is not causing the reported issue of the logo not rendered in the Customizer previewer when using Goran theme with Jetpack. But it is part of the integer vs string change @jokanane raised.

#19 @hellofromTonya
2 months ago

  • Keywords close added

Marking this ticket as a close candidate. Why? Test Team was able to reproduce the logo not rendering in the Customizer previewer and traced it to Jetpack. We were not able to reproduce the logo not rendering in the front-end and suspect an intermittent problem in Jetpack or another plugin which may be filtering the logo or conflicting with it. It does not seem to be a WordPress Core issue.

However before closing this ticket, will wait for reporter feedback on if deactivating all plugins except for Jetpack resolved the front-end rendering issue they are experiencing.

#20 @hellofromTonya
6 weeks ago

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

Closing this ticket as "invalid" which is a harsh term that (in this case) means the reported issue is due to a third party conflict (i.e. a plugin) rather than caused by WordPress Core itself.

@eqwmo if this problem persists, the next step might be to open a support request in the Support forum or in the plugin's support forum.

If however the problem is found to be due to core, please reopen.

Note: See TracTickets for help on using tickets.