Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

page-forum and shortcode code has been patched to resolve a bug when integration run as NOT LINKED USERS.
The problem come out when an user login in phpBB and is not recognized as logged by js code.
So that, to fix this aspect, has been necessary to add this line of code, that avoid the reload iframe loop:

where on top of both files
page-forum.php
and
/wp-content/plugins/wp-w3all-phpbb-integration/views/wp_w3all_phpbb_iframe_short.php


there is this code:

Code: Select all

// START MAY DO NOT MODIFY 

  if(defined("W3PHPBBCONFIG")){
    // detect if it is the uid2 in phpBB and avoid iframe loop 
    $phpBBuid2 = (isset($_COOKIE[W3PHPBBCONFIG["cookie_name"].'_u']) && $_COOKIE[W3PHPBBCONFIG["cookie_name"].'_u'] == 2) ? 2 : 0;
   } else { $phpBBuid2 = 0; }
become (+-):

Code: Select all

// START MAY DO NOT MODIFY 

  if(defined("W3PHPBBCONFIG")){
    // detect if it is the uid2 in phpBB and avoid iframe loop 
    $phpBBuid2 = (isset($_COOKIE[W3PHPBBCONFIG["cookie_name"].'_u']) && $_COOKIE[W3PHPBBCONFIG["cookie_name"].'_u'] == 2) ? 2 : 0;
   } else { $phpBBuid2 = 0; }
   // detect if it is no linked users mode and avoid iframe loop	
  if(defined("WPW3ALL_NOT_ULINKED")) { $phpBBuid2 = 0; }
so we'll have iframe integration fully working also in not linked users mode.
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

All custom shortcodes and widgets views files pointing to custom
wp-content/plugins/wp-w3all-config/
folder
will follow working, but the default way the folder is named from now on will be instead:
wp-content/plugins/wp-w3all-custom/

the related option on plugin admin page has been updated, as well remaining hints (like Retrieve posts on Last Topics Widget based on phpBB user's group that was not so clear)
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

about this:

Code: Select all

* Fix: definitively fix the important option "Disable existence check of the email in phpBB before it is updated in WordPress" that was setting at contrary the resulting effect enabled/disabled
it has been found a way that resolve the issue for frontend plugins email check.
Not so elegant: if an email duplicated found, the code just switch to the old one, without throwing any error or stop.
This last step should be done per case because each plugin normally go for his own way with vars in front-end scenarios.
Now the code, will not broke (for example) woocommerce payments ajax calls even when option active.

The problem has been fixed, for who like to see, just doing this (logic not complete nor precise, just example to be finished):

Code: Select all

function w3all_filter_pre_user_email($raw_user_email) {

 if ( is_user_logged_in() && ! is_admin() ) {
   // there is only the passed email to be updated (maybe): check if it exist already
   $raw_user_email = sanitize_email($raw_user_email);
   if( is_email($raw_user_email) && !email_exists($raw_user_email) ){ // if email do not exist, THEN maybe it is an update
    $ck = WP_w3all_phpbb::ck_phpbb_user( $user_login = '', $raw_user_email );
      global $w3all_oninsert_wp_user;
      if( !empty($ck) && $w3all_oninsert_wp_user != 1 ){
      	$wpu = get_user_by('ID',get_current_user_id());
      	$raw_user_email = $wpu->user_email; // reset to the old one, instead to stop with an error that will go to broke ajax calls or something else
        //temp_wp_w3_error_on_update('onlymsg');
        //exit;
      }
   }
 }
   
  return $raw_user_email;
}
so will be possible to use this without problems. The option will follow as deactivated by default. But it is ok now to be used if needed.

2.5.9 is coming!

p.s you could so say: why do not get directly user by email, instead of check for email exist? Let see what will be the faster that will be applied. But i think this is the faster for several reasons
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

Fixing under any aspect the last iframe shortcode, adding this easy concept to manage and detect if we are or not into WP home page (note how it has been resolved the issue to detect in Wordpress, if we are or not into the home page):
viewtopic.php?f=10&p=5608#p5608
i realize this instead:
and if we do not want an user be able to add the shortcode?
Let say we have roles in WP that allows to several groups to add new posts and pages into wordpress, what about if an user go to add our [w3allphpbbiframe] shortcode?
We could want to allow this only to certain groups.
*How to fix this easily?

2.5.9 will fix 4 aspects:
1) improve the correct detection, if the page we are on, is or not the homepage (and avoid always the url push into home: if it is needed the forum with pushed urls into homepage, then use page-forum instead, setting it as homepage page)
2) add param url_push that will allow for each shortcode to decide if, when links clicked into iframe, these will be pushed or not into browser (not sure if this explain is clear to all, presented like this, sorry, hope yes)
3) * add param option security_token security code for the shortcode: if the shortcode will contain the param with correct value, the shortcode will be parsed, if not, the shortcode will be not parsed. So that admins/owners site, will be sure that only certain groups will have the capability to add this shortcode, or only who know the required token.
4) ever detect if we are in template customize display or admin pages, and avoid shortcode execution in these cases
Stay cool lovely people, 2.5.9 is coming
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

for NOT LINKED USERS MODE
this line into page forum:

Code: Select all

  if(defined("WPW3ALL_NOT_ULINKED")) { $phpBBuid2 = 0; } // switch to be like it is uid2, so to avoid the reload of the page 
is wrong, lead to a loop in certain conditions
it need to be

Code: Select all

  if(defined("WPW3ALL_NOT_ULINKED")) { $phpBBuid2 = 2; } // switch to be like it is uid2, so to avoid the reload of the page
so it will be fixed both into page-forum and, for shortcode, into /views/wp_w3all_phpbb_iframe_short.php
User avatar
axew3
w3all User
w3all User
Posts: 2713
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Coming WordPress phpBB 2.5.9 and 2.5.8 report bugs

Post by axew3 »

2.5.9 will be released presumably today!
Two new params have been added into the awesome iframe shortcode and (i think) all possible bugs fixed (also hints have all been updated to be easier and precise)
https://www.axew3.com/w3/2022/02/the-aw ... shortcode/
Post Reply