Well, i've done everything according to install.txt, created an aliases "phpbbforum -> forums". Forum appears in page, looks good. But then i've noticed a bug: when i make a post, after it says that post was done, it redirects not to "forums/viewtopic.php...." but to it's actual directory where the forum is (phpBB3), in my case it is "forum-embeded" directory inside of drupal directory.
So instead of redirect to "forums/viewtopic.php...." it redirects to "forum-embeded/viewtopic.php....".
Same happening after deleting post/topic, adding a topic to a bookmarks and so on... (after every "action" followed by redirect from status message)

What is that? What can i do about it? Somebody else experienced this?

CommentFileSizeAuthor
#14 functions.zip38.4 KBJinson

Comments

subcomandante’s picture

I cannot reproduce this with beta8 and phpBB3.0.6

STINGER_LP’s picture

damn, i've reinstalled drupal, this module, configured it, and all seem work fine when path was "phpbbforum", when i created all aliases like mentioned below this bug appears, again. Don't know what's wrong. All was done correctly... and damn, i dong want to use "phpbbforum" as a forum path...

phpbbforum -> forum
phpbbforum/index.php -> forum/index.php
phpbbforum/viewtopic.php -> forum/viewtopic.php
phpbbforum/viewforum.php -> forum/viewforum.php
phpbbforum/viewonline.php -> forum/viewonline.php
phpbbforum/memberlist.php -> forum/memberlist.php
phpbbforum/posting.php -> forum/posting.php
phpbbforum/search.php -> forum/search.php
phpbbforum/ucp.php -> forum/ucp.php
phpbbforum/mcp.php -> forum/mcp.php
phpbbforum/faq.php -> forum/faq.php
phpbbforum/report.php -> forum/report.php
phpbbforum/adm/index.php -> forum/adm/index.php

vb’s picture

Check if clean urls are enabled, without this only phpbbforum path works.

STINGER_LP’s picture

The clean urls are enabled, and after aliases to 'phpbbforum' was created, I CAN navigate through the forum embedded in drupal page (and in address bar the path shows "forum") but after making a reply, deleting it and other actions forum redirects not back to forum embedded in drupal page with path "forum" but to "forum-embeded" - the actual folder within drupal installation where the phpBB engine is.

p.s. sorry for such complicated explanation, my english is poor for now.

teros0805’s picture

I'm having something similar happen to me. After replying to a topic I'm redirected back to the forum directory and not the alias and not to phpbbforum either. Therefore, embedding is lost. I thought it was just a path issue I'd figure out later since its not at the top of my agenda at this point in my testing.

STINGER_LP’s picture

Please if you solve that then post here how you did that.

teros0805’s picture

I will...if you figure it out please do the same and post your fix.

STINGER_LP’s picture

Status: Active » Fixed

OK, I figured out the reason of this problem. The physical directory where the phpBB installation is placed must be named ONLY "phpBB3"! In my case it was called "forum-embeded", after i renamed it to "phpBB3" all issues with wrong redirections after deleting post (or topic), adding a topic to a bookmarks and so on ARE GONE.

I think this need to be noted down in README.txt file in this module.

teros0805’s picture

Mines "forums". I'll try renaming it later and see if that fixes it for me.....thx (STINGER_LP) for posting.

filiptc’s picture

Status: Fixed » Needs work

Jeez, that's what it was. Always check for already existing issues before opening new ones. I had the same problem and fixed it (sort of) otherwise. Check #627770: Wrong meta-redirection after submitting.

This issue is not fixed. Fixing it would be patching the code to auto-detect the standalone phpBB path or reading it from user input. An other option is to clearly state not to rename the phpBB3 folder in the documentation.

filiptc’s picture

Version: 6.x-2.0-beta8 » 6.x-2.x-dev

Updating to reflect current status.

maria1992jhane’s picture

Paul Lomax’s picture

Add this to the .htaccess file in the root of phpbb/

<IfModule mod_rewrite.c>
  RewriteCond %{REQUEST_URI} ^\/phpbb3\/index\.php
  RewriteRule ^(.*)$ /phpbbforum/$1 [L,R]
</IfModule>
Jinson’s picture

Status: Needs work » Needs review
StatusFileSize
new38.4 KB

Here's my fix, seems to work fine so far.

includes/functions.php

Added this function

/**
 *
 * Modifies phpbb's generated URL to utilize the current URL that the page is being accessed from
 * @param string $url	phpbb generated destination url
 */
function getEmbeddedURL($url) {
	$protocol = ($_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
	$port = ($_SERVER['SERVER_PORT'] != '80') ? ':' . $_SERVER['SERVER_PORT'] : '';
	$currentURL = $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];

	$baseURL = str_replace(basename($_SERVER['REQUEST_URI']), '', $currentURL);
	$newURL = preg_replace('/(.+)\/([^\/]+)$/i', $baseURL . '$2', $url);

	return $newURL;
}

Then added 1 line in the meta_refresh function

function meta_refresh($time, $url, $disable_cd_check = false)
{
  global $template;

  $url = redirect($url, true, $disable_cd_check);
+ $url = getEmbeddedURL($url);
  
  //VB
....

Attached is the modified functions.php file for phpbb3 v.3.09 (after being patched by phpbbdrupalbridge)

fizk’s picture

Status: Needs review » Closed (fixed)