Opened 10 years ago
Closed 10 years ago
#5803 closed enhancement (fixed)
Query activity items by date
Reported by: | r-a-y | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Activity | Keywords: | has-patch |
Cc: |
Description
Was playing around with WP_Date_Query
for a plugin and spent a bit of time working up a patch for the activity component.
WP_Date_Query
is available since WP 3.7, but we support down to WP 3.6, so I've wrapped our extended BP_Date_Query
class around a conditional.
Patch includes unit tests. Maybe we can sneak this into 2.1?
Attachments (2)
Change History (11)
#2
@
10 years ago
- Owner set to r-a-y
- Resolution set to fixed
- Status changed from new to closed
In 8787:
#5
@
10 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
So after some investigation leading to r8795, the deconstructor was causing these tests to fail. At a PHP level, one of two error messages were observed by me in a local PHP 5.2 dev environment, running WordPress trunk.
- zend_mm_heap corrupted
- ALERT - linked list corrupt on efree() - heap corruption detected (attacker 'REMOTE_ADDR not set', file '/vagrant/wordpress/src/wp-includes/plugin.php', line 281)
Rolling back to older *recent* versions of WordPress trunk didn't fix the problem, but the fact that it's *not* happening on the 3.7/3.8/3.9 branches of WordPress suggest something has changed in 4.0/trunk regarding the management of actions/filters, that only reveals itself when in a PHP 5.2 environment. I have not diff'd the 3.9 branch against trunk to see if there are any obvious changes.
During debugging on WordPress trunk in the unit tests introduced by R-a-y for this change, I observed that I was unable to put any kind of logging in the __deconstruct
method, otherwise the PHP crashed with a segfault.
This ticket was mentioned in IRC in #buddypress-dev by paulgibbs. View the logs.
10 years ago
#7
@
10 years ago
Oh, and we should check if we're worried about not removing that action. R-a-y said he thinks it will probably be OK to leave as-is.
#8
@
10 years ago
Rolling back to older *recent* versions of WordPress trunk didn't fix the problem, but the fact that it's *not* happening on the 3.7/3.8/3.9 branches of WordPress suggest something has changed in 4.0/trunk regarding the management of actions/filters, that only reveals itself when in a PHP 5.2 environment. I have not diff'd the 3.9 branch against trunk to see if there are any obvious changes.
Yay for finding obscuro bugs! Nay for me trying to be too fancy with the destruct method.
Oh, and we should check if we're worried about not removing that action. R-a-y said he thinks it will probably be OK to leave as-is.
It's safe to leave it, but I've also added a patch if we need to remove our filter.
#9
@
10 years ago
- Resolution set to fixed
- Status changed from reopened to closed
I forgot to reference this ticket in the r8796 commit message:
---
Revert r8795; instead, fix the tests by skipping them if running in a PHP environment < 5.3.
The https://core.trac.wordpress.org/changeset/29251 change in WordPress trunk/4.0's unit test suite surfaces a bug in PHP 5.2 environments which causes segfaults with _destruct() for static class variables. See https://bugs.php.net/bug.php?id=51822.
As the new tests are only failing in PHP 5.2.17 with WP trunk (at revision 29466 at time of writing), we've decided to fix by requiring the date_query unit tests run only in PHP 5.3+ environments.
Wow! A nice surprise. And it's pleasantly surprising to see how easy it was to integrate. I say go with it for 2.1.