Skip to main content
Topic: Broken link redirects to 404 WSOD instead of board index (Read 9041 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: Broken link redirects to 404 WSOD instead of board index

Reply #30

That did the trick. :)

Re: Broken link redirects to 404 WSOD instead of board index

Reply #31

Quote from: Spuds – While I ponder what is going on ... for the can't load the main template error, for now I'd say just add
Code: [Select]
function template_main(){}
to the Portal.template..php file  obexit() is calling that template, just not sure from where or why.

On the recent posts link error, how do you have the blocks defined?  Are those blocks there for all actions, and which blocks specifically are on that page.  Trying to reproduce that error.


This now inadvertently causes WSOD for the Ultimate Menu addon. :P

 Burke Knight wonders why him and Ninja end up finding these strange oddities....

Re: Broken link redirects to 404 WSOD instead of board index

Reply #32

Probably because we are both professional bug spotters :P
~ SimplePortal Support Team ~

Re: Broken link redirects to 404 WSOD instead of board index

Reply #33

More like, the bugs are professional us spotters. :P

Re: Broken link redirects to 404 WSOD instead of board index

Reply #34

;D
~ SimplePortal Support Team ~

Re: Broken link redirects to 404 WSOD instead of board index

Reply #35

Lol...

Re: Broken link redirects to 404 WSOD instead of board index

Reply #36

Guessing it's because of a a template_main function in the mod as well.
That's tricky, template_main should really not be used, because of this very reason.
Best guess:
Code: [Select]
if (!function_exists('template_main')) {
    function template_main(){}
}
Not bullet proof, on the contrary it may very well fail the same way, but probably worth a try.
Bugs creator.
Features destroyer.
Template killer.

Re: Broken link redirects to 404 WSOD instead of board index

Reply #37

Quote from: emanuele – Guessing it's because of a a template_main function in the mod as well.
That's tricky, template_main should really not be used, because of this very reason.
Best guess:
Code: [Select]
if (!function_exists('template_main')) {
    function template_main(){}
}
Not bullet proof, on the contrary it may very well fail the same way, but probably worth a try.

No, still can't access settings page for Ultimate Menu.
I was wondering if a particular block was causing it, but seems not to be.
I've disabled all blocks, and still have the error.

EDIT:

I wonder, how would I add that bit to an if statement, to work, only on the main portal page, and no other page or action?

Re: Broken link redirects to 404 WSOD instead of board index

Reply #38

Well for the experiment lets try this for the time being ...
rename the
Code: [Select]
function template_main(){}
that you added to the Portal.template..php to
Code: [Select]
function template_portal_main(){}

Then in your sources directory find the file PortalIntegration.subs.php then find the following section
Code: (find) [Select]
		// Something portal-ish, then set the new action
if (isset($file, $function))
{
add after that
Code: (after) [Select]
			$context['sub_template'] = 'portal_main';

That should fix the main template conflict and should fix the problem, but I'm entering this on the fly and have not had time to do much testing  O:-)

Re: Broken link redirects to 404 WSOD instead of board index

Reply #39

Well.... Finally can do this new site, without wondering if needed to make a toggle in Admin, to add/subtract the line from Portal.template.php! LOL :)

Works like a charm, from what I can see.

Re: Broken link redirects to 404 WSOD instead of board index

Reply #40

@Spuds my friend, you are going to think this is as odd as we think...

I did the changes to all affected sites.
Now, the new one working on, seems to be the only one, with new issue, that goes away, if disable the portal.
Member Groups Page: missing all under the menu, as screen shot shows.
The Add Membergroup and Settings tabs work fine... it's just the Membergroup list tab....

EDIT: Can add 2 more pages: "Browse Files" & "Attachment Directories" both, in Attachments and Avatars section.

Re: Broken link redirects to 404 WSOD instead of board index

Reply #41

Looks like buildList() rears its ugly head ... not sure what to do ATM, will give this a look this weekend

Re: Broken link redirects to 404 WSOD instead of board index

Reply #42

Strange thing is, it's only the one site.
The portal files are all clones of the ones in WebMasters Haven site. Same with theme, except a couple minor changes.

Re: Broken link redirects to 404 WSOD instead of board index

Reply #43

Thats strange, but the issue was the drity work around I was trying to do ... anyway I had a thought, so let me try one thing on a test site and if it works I'll post it here in a few mins

Re: Broken link redirects to 404 WSOD instead of board index

Reply #44

OK .. once again on the run (sorry about this), but try the following:

First remove the the edits done to date, meaning remove the empty function we added to Portal.template.php and remove the line that was added to PortalIntegration.subs.php

Now find in PortalMain.controller.php
Code: (find) [Select]
	public function action_sportal_index()
{
global $context, $modSettings;

// Showing articles on the index page?
if (!empty($modSettings['sp_articles_index']))
{
require_once(SUBSDIR . '/PortalArticle.subs.php');
$context['sub_template'] = 'portal_index';

and replace it with
Code: (replace) [Select]
	public function action_sportal_index()
{
global $context, $modSettings;

$context['sub_template'] = 'portal_index';

// Showing articles on the index page?
if (!empty($modSettings['sp_articles_index']))
{
require_once(SUBSDIR . '/PortalArticle.subs.php');

That should make the sub_template available to the front page (so we don't get the can't find the main template error) but sill allow the buildList function to add its sub_template ...