Opened 12 months ago
Closed 6 months ago
#1835 closed defect (fixed)
Redirected to forum list after creatiing a reply
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.3 |
| Component: | Replies | Version: | trunk |
| Severity: | normal | Keywords: | has-patch |
| Cc: | georgemamadashvili@…, alexvorn2, wordpress@… |
Description
When a reply is sent, the topic should be shown not the forum list of topics...
Attachments (1)
Change History (25)
- Keywords reporter-feedback added
- Milestone changed from Awaiting Review to 2.1
Can't duplicate this on the latest or stable. Do you have specific duplication instructions?
- Keywords needs-patch reporter-feedback removed
- Milestone 2.1 deleted
- Resolution set to worksforme
- Status changed from new to closed
Tested with standard permalink formats; confirmed it's working as expected.
Closing pending more specific information.
- Resolution worksforme deleted
- Status changed from closed to reopened
http://www.screenr.com/XL08 I'm using WP 3.3.2, bbPress r3920
- <input type=”hidden” id=”_wpnonce” name=”_wpnonce” value=”01c15e206b” /><input type=”hidden” name=”_wp_http_referer” value=”/wordpress/?topic=topic-8″ /><input type=”hidden” id=”bbp_redirect_to” name=”redirect_to” value=”http://localhost/wordpress/wp-admin/edit.php?post_type=topic” /> + <input type=”hidden” id=”_wpnonce” name=”_wpnonce” value=”01c15e206b” /><input type=”hidden” name=”_wp_http_referer” value=”/wordpress/?topic=topic-8″ /><input type=”hidden” id=”bbp_redirect_to” name=”redirect_to” value=”http://localhost/wordpress/?forum=forum1%2F%2F” />
this is what I found comparing the files,
I reopened the ticket...
- Milestone changed from 2.1 to 2.2
- Priority changed from high to normal
Can you please reply with the following.
- Is this happening theme-side or admin-side?
- Can you include your server/bbPress configuration, and duplication steps so I can see what you see?
For reference, the function to troubleshoot is bbp_redirect_to_field(), in bbp-common-template.php.
I'm moving this to 2.2, since it's not a blocker and cannot be reproduced.
this is happening when permalinks are not set...
this is bbPress bug, I can set this on a hosting service so you can log in and test
comment:10
alexvorn2 — 11 months ago
I am using Windows 7 btw
comment:11
alexvorn2 — 11 months ago
// Rejig the $redirect_to
if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to == home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
$redirect_to = wp_get_referer();
}
// Make sure we are directing somewhere
if ( empty( $redirect_to ) ) {
$redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
}
if this part of code is removed everything is ok.
some variables:
$redirect_to - http://localhost/wordpress/?topic=topic-1 $_SERVER['REDIRECT_URL'] - null(nothing), should be /index.php home_url( $_SERVER['REDIRECT_URL'] ) - http://localhost/wordpress, (should be http://localhost/wordpress/index.php) home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' ) - http://localhost/wordpress/wordpress/?topic=topic-1 (should be http://localhost/wordpress/?topic=topic-1)
comment:12
alexvorn2 — 11 months ago
on linux server everything is ok
comment:13
alexvorn2 — 8 months ago
- Resolution set to fixed
- Status changed from reopened to closed
comment:14
MZAWeb — 6 months ago
- Cc wordpress@… added
- Resolution fixed deleted
- Status changed from closed to reopened
- Version changed from 2.0 to 2.2
This is still an issue on trunk: http://screencast.com/t/lNiz86Fqsn
comment:15
alexvorn2 — 6 months ago
it's a issue only on windows and mac os, 99% of the sites are on linux, that's why I closed the ticked because it had no attention from someone
comment:16
alexvorn2 — 6 months ago
- Keywords needs-patch added
- Milestone changed from 2.2 to 2.3
- Version changed from 2.2 to trunk
comment:17
MZAWeb — 6 months ago
On standard permalinks the bbp_redirect_to hidden is being set incorrectly. Looking into it
comment:18
MZAWeb — 6 months ago
The problem is in http://bbpress.trac.wordpress.org/browser/trunk/includes/common/template-tags.php#L1076
1) $_SERVERREDIRECT_URL? is apache only. And I think depends on configuration.
2) Even if the server meets the requirements, $_SERVERREDIRECT_URL? returns the path after the domain. When permalinks are off, it returns empty, and in that case we're getting wp_get_referer() which I think is not the intended functionality in this case.
But bbp_redirect_to_field is used quite a bit across the code... I'm not sure I totally understand what I will break if I try to patch this.
comment:19
MZAWeb — 6 months ago
- Keywords 2nd-opinion added
Agree that getting rid of the Apache specific tags is best. The problem is the use of wp_get_referer(), which isn't the correct function here. We don't want to redirect to the referrer, we want to redirect usually back to the current page the user is on. If there's some reason the user doesn't belong there, template_redirect will usually take care of that.
comment:21
MZAWeb — 6 months ago
- Keywords 2nd-opinion removed
- Owner set to MZAWeb
- Status changed from reopened to new
comment:22
MZAWeb — 6 months ago
- Keywords has-patch needs-testing added; needs-patch removed
Patch seems to do the trick. Works both with and without permalinks, in apache and nginx. It could use some testing with IE, though.
comment:23
alexvorn2 — 6 months ago
- Keywords needs-testing removed
for me the patch works too, Windows 7
- Resolution set to fixed
- Status changed from new to closed
This works ok when permalinks are set, but if the Common Settings is set to Default then it is working like described in the ticket.