Wrong meta-redirection after submitting

filip_tc - November 9, 2009 - 16:30
Project:phpBBforum Integration module
Version:6.x-2.0-beta7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

First of all let me apologize if this is a duplicate. I did a quick search but did not find any similar issue. Secondly, again sorry if I missed something out in the documentation (/README).

Lets say the standalone folder is 'forum_standalone' and the embedded is just 'forum'. Everything works great until someone posts (hapens with new topic or any kind of posting). Posting works fine, the redirecting windows comes up just fine too but the redirection is done to 'forum_standalone'.

Can this be fixed?

Thanks,
Phil.

#1

filip_tc - November 9, 2009 - 18:07

Ok, I looked into the problem and it seems that the links on the redirection page are built fine (point towards the embedded forum) but the one in the refresh meta tag is not.

The code that seems not to be working is in forum-standalone/includes/functions.php lines 2312-2325:

<?php
...
 
//***VB***
 
if (defined('PHPBB_API_EMBEDDED'))
  {
   
$url = phpbbforum_redirect($url, $time);
  }
 
//***VB***

    // For XHTML compatibility we change back & to &amp;
   
$template->assign_vars(array(
       
'META' => '<meta http-equiv="refresh" content="' . $time . ';url=' . $url . '" />')
    );

    return
$url;
}
...
?>

I'll keep digging.... =)

#2

filip_tc - November 9, 2009 - 18:08
Component:User interface» Code

#3

filip_tc - November 9, 2009 - 18:16

Introducing...

<?php
$url
= str_replace('forum-standalone', 'forum', $url);
?>

...inside or outside of...
<?php
if (defined('PHPBB_API_EMBEDDED'))
?>

...does not seem to fix the problem.

Redirection error seems to be general after any operation (except for ACP login, obviously).

#4

filip_tc - November 11, 2009 - 17:08

EDIT: Careful, 'forum-standalone' stands for the non-embedded forum folder (this usually is 'phpBB3') and 'forum' is the embedded URL. This may vary in your case.

Marking the option "Immediate redirect" does not fix the problem.

I found that a temporary fix is to insert the following command on line 2299.

<?php
    $url
= str_replace('forum-standalone', 'forum', $url);
?>

just after
<?php
function meta_refresh($time, $url, $disable_cd_check = false)
{
    global
$template;
?>

Strangely, it does not work to instead insert phpbbforum's function:

<?php
$url
= _phpbbforum_replace_urls($url);
?>

I'm not familiar at all with this module's architecture and I don't know enough to find a real fix for this issue.

#5

filip_tc - November 9, 2009 - 19:08
Title:Redirect to standalone phpBB3 after posting.» Wrong redirection after submitting

Changing tilte for accuracy.

#6

filip_tc - November 11, 2009 - 16:04
Title:Wrong redirection after submitting» Wrong meta-redirection after submitting
Status:active» needs work

Sorry for the fumble. Again, better accuracy.

#7

vb - November 11, 2009 - 16:15

>Can this be fixed?
I do not know the exact case where it occurs in my installations.

#8

filip_tc - November 11, 2009 - 17:12

I don't understand what you mean. I did a blank install of drupal, a blank install of phpBB3.05 and set phpbbforum to integrate it into drupal (no iframe). No matter if posting is set to meta redirect or immediate redirect, the problem appears anyway.

If you need more info, could you be more specific?

Thanks!

#9

vb - November 11, 2009 - 17:29

Look at http://drupalbridge.org/ how meta-redirect is working. Find the issue.

 
 

Drupal is a registered trademark of Dries Buytaert.