Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 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 9 years ago.
Simple patch to ensure data is saved

Download all attachments as: .zip

Change History (14)

@westi9 years ago

Simple patch to ensure data is saved

comment:1 @davidhouse9 years ago

Oh, for PHP5 and destructors :)

comment:2 @markjaquith9 years ago

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

comment:3 @westi9 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.

comment:4 @markjaquith9 years ago

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

comment:5 @ryan9 years ago

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

comment:6 @westi9 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.

comment:7 @skeltoac9 years ago

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

comment:8 @skeltoac9 years ago

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

comment:9 @westi9 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;

comment:10 @terado9 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:

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

comment:11 @mdawaffe9 years ago


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

comment:12 @ryan9 years ago

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

comment:13 @anonymous8 years ago

  • Milestone 2.0.3 deleted

Milestone 2.0.3 deleted

Note: See TracTickets for help on using tickets.