Serializing the query class is currently possible by simply calling serialize($query), but the results aren't very satisfying as the index object is completely serialized, too. This, of course, leads to a massively larger serialized string than would be necessary. Therefore, modules like Saved Searches have to implement their own way of serializing query objects.

With an almost trivial implementation of __sleep() and __wakeup(), we can easily solve this.

Comments

drunken monkey’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

Patch attached.

drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.