#4339 closed defect (bug) (fixed)
Repeat footer - eq4.us
Reported by: | rbasmaji | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | normal | Version: | 1.6 |
Component: | Templates | Keywords: | needs-patch needs-testing dev-feedback |
Cc: |
Description
By adding BP 1.6 beta 2 plugin, the footer on all site pages (www.eq4.us) repeats. When I remove the BP plugin, the repeat text disappears. Also, the original text is formatted and center-aligned (perhaps by virtue of <div class="credits"> command), whereas the repeat text is unformatted and left-aligned. I am using WP theme "Custom Community" By Themekraft Version 1.8.9.1
Robert
rbasmaji@…
Attachments (3)
Change History (23)
#1
follow-up:
↓ 2
@
12 years ago
- Component changed from Core to Theme
- Keywords reporter-feedback added
#6
@
12 years ago
not sure how the assignment system works, if i should assign it to myself, to my website, or something else...
#7
@
12 years ago
- Keywords dev-feedback added
- Owner changed from rbasmaji to johnjamesjacoby
The problem can be traced to https://buddypress.trac.wordpress.org/changeset/5736. Prior to this change, the 'bp_footer' hook was called directly in footer.php (as was the wp_footer()
function). Themes that were based on bp-default copied this implementation. After r5736, our 'bp_footer' is hooked to 'wp_footer', which means that in these 1.5-era themes, the 'bp_footer' action is fired twice: once when it's called manually, and once when it's hooked to 'wp_footer'.
This is probably going to cause similar problems for loads of WP themes (even children of bp-default are highly likely to have overridden footer.php), so I'd advocate reverting the change, and moving the do_action() back into footer.php. On a theme rewrite in a future version, we can go back to JJJ's method.
#8
@
12 years ago
is there any action i can take to manually correct the files? i looked in my file manager in public_html/wp-content/plugins/buddypress/bp-core and i do not see a bp-core-hooks file. i was able to find the footer.php file in its location.
#9
@
12 years ago
thanks a great deal for your response boonegeorges, i really appreciate your help.
#10
follow-up:
↓ 14
@
12 years ago
is there any action i can take to manually correct the files?
Yes. In your theme's footer.php, there will be a line that looks something like this:
<?php do_action( 'bp_footer' ) ?>
Remove it.
i really appreciate your help.
You're welcome. Thanks for the report :)
#11
follow-up:
↓ 12
@
12 years ago
Or we could put a did_action() check in our bp_footer/header() functions. Might need to adjust action priority for this. ?
#12
in reply to:
↑ 11
@
12 years ago
Replying to DJPaul:
Or we could put a did_action() check in our bp_footer/header() functions. Might need to adjust action priority for this. ?
did_action() checks are reasonable. Would prevent running the actions twice, regardless of their locations.
#13
follow-up:
↓ 16
@
12 years ago
did_action()
is a good idea, though ideally we would always demur in favor of the hardcoded template-level do_action(). did_action()
will only work if wp_footer()
is called *after* do_action( 'bp_footer' )
is called in the template. This is the case in bp-default 1.5.x https://buddypress.trac.wordpress.org/browser/branches/1.5/bp-themes/bp-default/footer.php, which should mean that the majority of child themes are doing it in this order too. Still, there may be themes that have switched it around, and did_action()
won't help them.
#14
in reply to:
↑ 10
@
12 years ago
Hello again. Thanks again for your feedback - I followed the instructions on deleting the do_action ('bp_footer') line from my theme's footer.php, and it worked to an extent. You will see what happened in the attached jpeg file. it deleted the original footer and left the misaligned new footer in the lefthand corner of the screen...so I'm wondering if there is a way to get rid of the new footer and keep the old one. Thanks in advance for the help -Robert
Replying to boonebgorges:
is there any action i can take to manually correct the files?
Yes. In your theme's footer.php, there will be a line that looks something like this:
<?php do_action( 'bp_footer' ) ?>Remove it.
i really appreciate your help.
You're welcome. Thanks for the report :)
#16
in reply to:
↑ 13
@
12 years ago
Replying to boonebgorges:
Still, there may be themes that have switched it around, and
did_action()
won't help them.
If BP's default templates have always been like this, I'd suggest we not worry about this edge case. Either way, it's do this or revert the original change for 1.6, and we can come back to this in 1.7. Either way, let's decide quickly. I don't have a huge preference either way.
#17
@
12 years ago
Thanks, DJPaul. Moving bp_footer and bp_head to separate actions doesn't have any concrete benefit, aside from greater consistency and possible modularity down the road. So I think reverting is the right choice.
#18
@
12 years ago
- Resolution set to fixed
- Status changed from assigned to closed
(In [6177]) Reverts piggybacking of bp_head and bp_footer actions from r5736.
Moving the bp_head and bp_footer actions outside of the template, and
piggybacking them on WP core actions, causes problems for backward
compatibility with themes that have mimicked BP's previous behavior of
hardcoding the actions.
Fixes #4339
Thanks for reporting this. Did this happen with beta 1?