Skip to:
Content

BuddyPress.org

#9056 closed defect (bug) (fixed)

Customizer Shows 404 Error When Home Page is Set to a Directory Page

Reported by: vapvarun's profile vapvarun Owned by: imath's profile imath
Milestone: 12.1.0 Priority: normal
Severity: normal Version: 12.0.0
Component: Core Keywords: has-patch
Cc:

Description

In BuddyPress v12.0, there is an issue where setting a directory page as the homepage leads to a 404 error in the WordPress customizer. This problem occurs with directory pages; regular pages do not encounter this issue. An attempt was made to resolve this by adjusting the BP directory page configuration to recognize customizer previews, but the solution requires further configuration.

​https://www.loom.com/share/5e096226f577426d8bc17b361c8631f1

Change History (12)

#1 @imath
11 months ago

  • Version set to 12.0.0

Thanks a lot for your report @vapvarun I’ll look at it asap πŸ‘

This ticket was mentioned in ​PR #212 on ​buddypress/buddypress by ​@imath.


11 months ago
#2

  • Keywords has-patch added

Introduce bp_is_site_home() to check requested URL is site home even into the customizer.

Trac ticket: ​https://buddypress.trac.wordpress.org/ticket/9056

#3 @imath
11 months ago

In 13689:

Make sure a BP directory used as home can be previewed in customizer

Introduce the bp_is_site_home() function to check requested URL is the same than site's home one even into the customizer.

Props vapvarun

See #9056 (trunk)
Closes ​https://github.com/buddypress/buddypress/pull/212

#4 @imath
11 months ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 13690:

Make sure a BP directory used as home can be previewed in customizer

Introduce the bp_is_site_home() function to check requested URL is the same than site's home one even into the customizer.

Props vapvarun

Fixes #9056 (branch 12.0)

#5 @imath
11 months ago

  • Keywords needs-patch added; has-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

This fix had a side effect on the BP Email customization feature showing the front page instead of the email to preview.

This ticket was mentioned in ​PR #215 on ​buddypress/buddypress by ​@imath.


11 months ago
#6

  • Keywords has-patch added; needs-patch removed

​r13689 introduced a side effect with the BP Email customization feature. Instead of showing a random Email it was showing the site’s home page when a BP Directory was set as the home page. The PR is making sure to avoid overriding the WP Request when a BP Email is being previewed into the customizer.

Many thanks to @emaralive for reporting this issue.

Trac ticket: ​https://buddypress.trac.wordpress.org/ticket/9056

​@emaralive commented on ​PR #215:


11 months ago
#7

I'm not sure where I need to do (write) this, so I'll do it here in a comment and, as such, represents a continuance of the January 8, 2024 Dev-chat.

I tested this PR and it does what is intended (random email now appears in customizer), however, there is an unintended consequence that now reveals itself, which is:

Deprecated: Function the_block_template_skip_link is deprecated since version 6.4.0! Use wp_enqueue_block_template_skip_link() instead. in /wp-includes/functions.php on line 6033

Along with the previous notice mentioned in Dev-chat, which to repeat is:

Notice: Trying to get property 'title' of non-object in /wp-includes/class-wp-customize-widgets.php on line 905

As an aside, these one line error notifications are interesting (for lack of a better word) and, on another day, would be a useful conversation as to why a more expansive backtracing isn't provided but, today is not that day.

Moving along, I was able to backtrace the Deprecation notice for the function block_template_skip_link to the following file:

​single-bp-email.php

The function wp_footer() appears to be the source and the remedy to squash the deprecation notice is either to remove the filter 'wp_footer' with the callback function the_block_template_skip_link e.g., prior to/before wp_footer() add something like the following:

if ( has_action( 'wp_footer', 'the_block_template_skip_link' ) ) {
    remove_action( 'wp_footer', 'the_block_template_skip_link' );
}

Or

Replace **wp_footer() with the recommended replacement wp_enqueue_block_template_skip_link(). N.B., This option requires an extra mouse click to expose the "Header, Body & Footer" panels.

Both options, to me, appear to work but, I'll leave it up to you to find a remedy to your liking. As to the other notice; Trying to get property 'title' of non-object is still an opportunity in finding the source for this.

​@imath commented on ​PR #215:


11 months ago
#8

Thanks a lot for you tests, I'll update the PR to get rid of these notices πŸ˜‰

​@imath commented on ​PR #215:


11 months ago
#9

@emaralive my last commit is fixing the deprecated notice. About the Warning one, to me it needs to be fixed by WordPress, so I'll report a ticket about it upstream.

​@emaralive commented on ​PR #215:


11 months ago
#10

Ok, sounds good! :+1:

#11 @imath
11 months ago

In 13692:

Make sure a random email is previewed when customizing BP Emails

[13689] introduced a side effect with the BP Email customization feature. Instead of showing a random Email it was showing the site’s home page when a BP Directory was set as the site's front page. This change is making sure a random BP Email will be previewed even if a BP Directory is the site's front page.

A deprecated notice with WordPress 6.4 has also been resolved and a warning notice has been reported upstream as, to our point of view, the WP Customizer shouldn't load the widgets component when a Block Theme is used for the site. See ​WP60236.

Props emaralive

See #9056 (trunk)
Closes ​https://github.com/buddypress/buddypress/pull/215

#12 @imath
11 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 13693:

Make sure a random email is previewed when customizing BP Emails

[13689] introduced a side effect with the BP Email customization feature. Instead of showing a random Email it was showing the site’s home page when a BP Directory was set as the site's front page. This change is making sure a random BP Email will be previewed even if a BP Directory is the site's front page.

A deprecated notice with WordPress 6.4 has also been resolved and a warning notice has been reported upstream as, to our point of view, the WP Customizer shouldn't load the widgets component when a Block Theme is used for the site. See ​WP60236.

Props emaralive

Fixes #9056 (branch 12.0)

Note: See TracTickets for help on using tickets.