ACP menu disappears

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
MarkDHamill
Registered User
Posts: 4886
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

ACP menu disappears

Post by MarkDHamill »

This has been a minor nit for years. In my digests extension, and only in a Manually run the mailer function, after the function runs and trigger_error is triggered, the ACP menu on the left disappears. This doesn't happen for my other ACP modules.

acp_menu.png

This likely has something to do with it calling a function used by my cron to mail digests from inside the ACP, which is normally handled by a cron process. Click on the link and it goes away. It's hardly critical, just inconsistent. The block of code where I call the run function for my cron from the ACP is here:

https://github.com/MarkDHamill/digests/ ... 1671-L1692

For a while on phpBB 3.1 I had it working but with 3.2 the kludge didn't work anymore. I don't remember what I did but it seemed moot as it didn't work.

Any ideas?
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: ACP menu disappears

Post by GanstaZ »

In what environment did you test it (prod or dev)?
Last edited by GanstaZ on Tue Jan 18, 2022 1:51 pm, edited 1 time in total.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
MarkDHamill
Registered User
Posts: 4886
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: ACP menu disappears

Post by MarkDHamill »

Development environment, but everyone reports it happens in production too.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: ACP menu disappears

Post by GanstaZ »

Hmm.. I don't remember if i saw it, when i tested your extension some years ago, but it should be up on one of my computers. When i have time, i will take a look.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
MarkDHamill
Registered User
Posts: 4886
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: ACP menu disappears

Post by MarkDHamill »

Many thanks. It's something buried deep in phpBB's code.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: ACP menu disappears

Post by GanstaZ »

It is possible that at one point (for example this case),.. modules menu is not generated, because of current module system, but it still needs some testing, so it is hard to say, what is the cause for this situation.. As i'm still recovering and waiting for my new PC, it will take some time.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
User avatar
MarkDHamill
Registered User
Posts: 4886
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: ACP menu disappears

Post by MarkDHamill »

I believe that I used modules right from the start.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4886
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: ACP menu disappears

Post by MarkDHamill »

Good news! I figured it out! It's been a couple of years since I looked at this.

In my extension's /controller/acp_controller.php after these lines I added:

Code: Select all

			if ($mode == 'digests_test')
			{
				// This code will place the modules in the ACP sidebar, which otherwise would disappear
				$module_id	= $this->request->variable('i', '');
				$mode		= $this->request->variable('mode', '');
				$module 	= new \p_master();
				$module->list_modules('acp');
				$module->set_active($module_id, $mode);
				$module->assign_tpl_vars(append_sid("{$this->phpbb_root_path}adm/index.$this->phpEx"));
			}
This allows a set of <li> tags to get created in the ACP sidebar. The key was noticing these tags were missing when I viewed the HTML source for the page then figuring out what code populated the tags, which is in /adm/index.php.

Thanks for volunteering to look at this.
Last edited by MarkDHamill on Tue Jan 18, 2022 8:15 pm, edited 2 times in total.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
GanstaZ
Registered User
Posts: 1187
Joined: Wed Oct 11, 2017 10:29 pm
Location: GZOverse

Re: ACP menu disappears

Post by GanstaZ »

No problems.. I still need to dig into cp's & testing).. Good that you found the issue.
Usus est magister optimus! phpBB pre-Triton & latest php environment.
When answer lies in the question, question becomes redundant!
Post Reply

Return to “Extension Writers Discussion”