Extension listener still active while extension disabled

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
v12mike
Registered User
Posts: 519
Joined: Thu Jul 09, 2015 5:03 pm

Extension listener still active while extension disabled

Post by v12mike »

I have an extension running on a live forum (v3.2.0) that has been working OK for some time, but I wanted to disable it and enable another extension.

The problem is that When I disable the first extension in the ACP, although it appears to be disabled, the listener is still called, and is manipulating template data as if it were still enabled.

I did try setting an xdebug breakpoint on the listener function on the live forum and the breakpoint is hit with the extension disabled.

I can't reproduce this on a test forum running (I believe) the same code base, and don't want to try anything too drastic on the live forum.

The problem does not affect another live forum which is running the same codebase and same extension.

The extension is a slightly modified version of https://github.com/v12mike/camosslimageproxy

Any ideas as to what is going on here?

[edit] maybe related to viewtopic.php?f=461&t=2430031 ?
v12mike
Registered User
Posts: 519
Joined: Thu Jul 09, 2015 5:03 pm

Re: Extension listener still active while extension disabled

Post by v12mike »

I have found a work-around which will greatly help in pinning down the bug. The extension is disabled properly if after disabling in the ACP, the cache directory is manually deleted.

The board in question is using an APCu cache, but so is the board that does not have the problem. I will try to localise the problem further.
v12mike
Registered User
Posts: 519
Joined: Thu Jul 09, 2015 5:03 pm

Re: Extension listener still active while extension disabled

Post by v12mike »

I have narrowed the problem down.

In the cache driver file: phpbb\cache\driver\memory.php at line 30:
$this->cache_dir = $phpbb_container->getParameter('core.cache_dir');
is returning NULL

This means that any cache purge functions fail to purge the file cache...
User avatar
david63
Registered User
Posts: 18437
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: Extension listener still active while extension disabled

Post by david63 »

If you believe that you have found a bug then you should report it in the Bug Tracker
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
v12mike
Registered User
Posts: 519
Joined: Thu Jul 09, 2015 5:03 pm

Re: Extension listener still active while extension disabled

Post by v12mike »

I have created an issue. I was hoping to track down a root cause, but it has got beyond my understanding of how symphony is initialised (and how to debug it).
User avatar
3Di
Former Team Member
Posts: 16039
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Extension listener still active while extension disabled

Post by 3Di »

Did you try to use the $cache object instead of globalizing it and make a construct ?

Code: Select all

	/** @var \phpbb\cache\service */
	protected $cache;
Generally speaking you are globalizing stuffs instead of using objects which it is ok for the modules that are still decoupled, but in the listener.
To request support for our extensions you can also contact me here: phpBB Studio

Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
🚀 Looking for a specific feature or alternative option? We will rock you! 🚀
v12mike
Registered User
Posts: 519
Joined: Thu Jul 09, 2015 5:03 pm

Re: Extension listener still active while extension disabled

Post by v12mike »

3Di wrote:
Thu Jul 27, 2017 8:29 pm
Did you try to use the $cache object instead of globalizing it and make a construct ?

Code: Select all

	/** @var \phpbb\cache\service */
	protected $cache;
Generally speaking you are globalizing stuffs instead of using objects which it is ok for the modules that are still decoupled, but in the listener.
I do not understand your post. Where is (or should be?) that code snippet located?

I only mentioned the extension, as the symptom that I initially saw was that the extension was not disabling properly, but the bug affects any extension that required the cache to be purged, as well as the cache purge button in the ACP.

The memory cache bug is not (as far as I know) dependent on having any extensions installed, and could be active on a stock phpBB 3.2 install if a memory cache is used.

I have not changed anything in any source file that is (as far as I know) related to this bug.
Post Reply

Return to “Extension Writers Discussion”