Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#2387 closed defect (bug) (fixed)

Caching makes activate/deactivate plugin hooks unusable

Reported by: westi Owned by: markjaquith
Milestone: Priority: high
Severity: normal Version: 2.0
Component: Administration Keywords: bg|has-patch bg|commit
Focuses: Cc:


I've just spent an hour of so trying to work out why my activate/deactivate hooks were not working.

I turned out they were only updating the in-memory cache and so never making it to the db.

Patch attached for this instance but we need to review all exit's to check whether we should flush to disk or not.

Attachments (1)

2387.diff (312 bytes) - added by westi 12 years ago.
Simple patch to ensure data is saved

Download all attachments as: .zip

Change History (14)

12 years ago

Simple patch to ensure data is saved

#1 @davidhouse
12 years ago

Oh, for PHP5 and destructors :)

#2 @markjaquith
12 years ago

  • Keywords bg|commit added
  • Owner changed from westi to markjaquith
  • Status changed from new to assigned

#3 @westi
12 years ago

  • Milestone changed from 2.1 to 2.0.3

Can this be a candidate for 2.0.3 as it makes activate/deactivate hooks dumb without this fix.

It will still need fixing for 2.1 as well.

#4 @markjaquith
12 years ago

object cache is turned off by default for 2.0.3, but it still would be nice to get this fixed.

#5 @ryan
12 years ago

The shutdown hook is run on exit. Wonder why the close isn't being called by the hook.

#6 @westi
12 years ago

Can we be sure that the shutdown func is always called on exit for all supported php types?

Afterall calling exit itself within a shutdown func will stop all the others from running.

#7 @skeltoac
12 years ago

What code was triggered by this hook when you found the problem?

#8 @skeltoac
12 years ago

What code was triggered by this hook when you found the problem?

#9 @westi
12 years ago

I was using the activate and deactivate hooks to add/remove a cap on the administrator like so:

	function activate()
		global $wp_roles;

	function deactivate()
		global $wp_roles;

#10 @terado
12 years ago

I don't know how the versioning process takes place. However, for 2.0.3 as mentioned here the cache was disabled by default, this is quite a big change actually and affected a lot of things my end. This was not mentioned in changelog: http://codex.wordpress.org/Changelog/2.0.3

Just a request really that changes, not just fixes, be put through to the changelog as they do affect things. Thanks

#11 @mdawaffe
12 years ago


svn co http://svn.automattic.com/wordpress/branches/2.0
svn log -r 3825:3637

#12 @ryan
12 years ago

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

#13 @(none)
11 years ago

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.