Opened 12 years ago
Closed 12 years ago
#4550 closed defect (bug) (fixed)
BP_VERSION / BP_DB_VERSION constants are empty
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 1.7 | Priority: | normal |
Severity: | major | Version: | 1.7 |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
Because the BuddyPress::constants()
method is called before BuddyPress::setup_globals()
(where the version variables are defined), it's impossible to set the BP_VERSION
and BP_DB_VERSION
constants.
In the attached patch, I have moved $version
and $db_version
out of setup_globals()
and into main class properties so the constants will still work and will not break any existing plugins relying on them.
Attachments (2)
Change History (7)
#3
@
12 years ago
Here's an alternate patch in line with JJJ's suggestion. I didn't touch the search slug, and
all other constants besides BP_VERSION
and BP_DB_VERSION
are used in setup_globals()
, so the legacy constants method ended up pretty bare.
I'd rather we reverse this approach for non-bootstrap constants; have a legacy constants method/function to separate non-essential constants (that aren't used anywhere by BuddyPress core anymore) apart from the overloading-constants (like _SLUG).
(Edit: huge run-on sentence; add punctuation.)