Skip to:
Content

BuddyPress.org

Opened 6 years ago

Closed 4 years ago

#6136 closed defect (bug) (fixed)

ajaxurl js variable defined multiple times

Reported by: slaFFik Owned by: slaFFik
Milestone: 2.6 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

In different parts of BuddyPress ajaxurl is added to the site <head> section multiple times:

Messages, Core, BP-Legacy

This results in several such outputs in html

var ajaxurl = 'http://bpge.ovi/wp-admin/admin-ajax.php';

In BuddyPress 2.1.1 and BuddyPress Trunk (as for now)

Attachments (1)

6136.patch (1.2 KB) - added by slaFFik 4 years ago.

Download all attachments as: .zip

Change History (7)

#1 @r-a-y
6 years ago

  • Keywords dev-feedback added

I brought this up awhile ago - #4670.

I tend to agree with you though.

#2 @boonebgorges
6 years ago

  • Keywords needs-patch added; dev-feedback removed
  • Milestone changed from Awaiting Review to Future Release

While it's true (as noted in #4670) that this'll always be an issue when multiple plugins are running, it's possible for us to be less redundant internally. If bp-core is defining ajaxurl on every page, it probably doesn't need to be done in the other places.

@slaFFik
4 years ago

#3 @slaFFik
4 years ago

  • Keywords has-patch added; needs-patch removed

Seems @r-a-y fixed in Messages component a while ago, so 2 places are left: Core and BP-Legacy.
As per @boonebgorges suggestion I removed from BP-Legacy, see 6136.patch attached.

#4 @slaFFik
4 years ago

  • Owner set to slaFFik
  • Status changed from new to assigned

#5 @slaFFik
4 years ago

  • Milestone changed from Future Release to 2.6

#6 @djpaul
4 years ago

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

In 10655:

BP-Legacy: remove redundant JS ajaxurl variable.

BuddyPress always prints this on every page in
bp_core_add_ajax_url_js, so doing it here again results in a
duplicate, and is useless.

Fixes #6136

Props slaFFik

Note: See TracTickets for help on using tickets.