Skip to:

Opened 10 years ago

Closed 10 years ago

#5257 closed defect (bug) (fixed)

Missing page titles on BP 404 pages

Reported by: henrywright's profile henrywright Owned by: boonebgorges's profile boonebgorges
Milestone: 1.9 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch


This issue started happening from 1.9 beta 1. Hence it could be related to the recently resolved ticket: 5149.

When visiting a BP page that doesn't exist such as:

a page title <title>example</title> isn't output.

In contrast, when visiting a WP page that doesn't exist such as:

a page title is output.

Note I have root profiles enabled. define ( 'BP_ENABLE_ROOT_PROFILES', true );

Attachments (1)

5257.patch (768 bytes) - added by henrywright 10 years ago.

Download all attachments as: .zip

Change History (15)

#1 @boonebgorges
10 years ago

  • Keywords reporter-feedback added

I can't reproduce this. When I visit, where 'foo' does not exist, I get:

<title>Page not found | My WP Installation</title>

(where "My WP Installation" is the name of my installation)

The 404 template is also loaded as expected.

This looks to me to be consistent whether root profiles are on or off.

Can you give more details about your setup?

#2 @henrywright
10 years ago

Hi boonebgorges - thanks for investigating. I've been testing on a site which uses WP 3.7.1, BP 1.9 beta 1. Root profiles are enabled and BuddyPress Follow is active. Twenty Thirteen is the theme. Permalinks are set to /%post_id%/. Aside from that everything is completely unmodified and as it arrived out-of-the-box.

Let me know where to ping the details if you need admin or FTP access:

#3 @henrywright
10 years ago

  • Keywords reporter-feedback removed

#4 @boonebgorges
10 years ago

Can you disable root profiles for a moment to see if that's actually the root (no pun intended) of the problem?

#5 @henrywright
10 years ago

I just tried again with root profiles disabled and no luck. The problem still happens.

I just get <title> | Jobtain</title> as the page title.

#6 @boonebgorges
10 years ago

Hm. I'm afraid that, without being able to reproduce locally, there's not much I can do. You could help by tracing the issue a bit on your problematic installation. You might start with bp_modify_page_title() in bp-core/bp-core-filters.php.

#7 @henrywright
10 years ago

Interestingly when I visit the members directory I get the page title you would expect.

<title> Page not found | Jobtain</title>

But when I visit the sitewide activity page I get the broken page title

<title> | Jobtain</title>

#8 @henrywright
10 years ago

Thanks for the idea of where to look - I think the problem is definitely associated with the logic in that function because removing && !is_404() from line 358 resolves the problem for /members/username/jahayatsfg

That said, is still giving <title> | Jobtain</title>

#9 @henrywright
10 years ago

To resolve this for the sitewide activity page, I added

if ( is_404() ) 
    return $title;

right after

global $bp;

A few questions remain

  1. Would this break stuff elsewhere?
  2. Considering you can't reproduce - Is the problem related to my install? i.e. is this fix even needed? - i'm puzzled because the install is completely un-customised.

#10 @r-a-y
10 years ago

I can duplicate henrywright's page title problem when:

  • Root profiles are enabled and when navigating to a non-existing profile page like:

  • Navigating to a non-existing group page like:
  • Navigating to an existing group with a non-existing nav page like should use the 'Page Not Found' title instead of the group name.

henrywright's fix sounds good to me.

A small tidbit is if you have bbPress enabled and you encounter the profile 404 bug, the page title will use the page title set by bbPress instead (USERNAME's profile). Need to post a ticket on bbP trac.

10 years ago

#11 @henrywright
10 years ago

Please find the patch attached.

#12 @henrywright
10 years ago

  • Keywords has-patch added

#13 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 1.9

Ah, my apologies, I wasn't able to reproduce because of a plugin conflict. henrywright, your fix looks appropriate to me.

#14 @boonebgorges
10 years ago

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

In 7612:

Don't modify <title> element when is_404()

Fixes #5257

Props henrywright

Note: See TracTickets for help on using tickets.