Page 1 of 2

iFrame Forum/WP error

Posted: Sat Feb 09, 2019 9:37 am
by xray
I am catching a couple of errors and a little confused on the fix. The errors appear in the wp-forum plugin

This is the error?
if ( href.charAt(0) == '#' && href.length == 1 || /^#[a-z0-9]+$/ig.exec(href) !== null && href.length < 8 ){


Uncaught TypeError: Cannot read property 'charAt' of undefined
at HTMLAnchorElement.<anonymous> (ucp.php?i=ucp_notifi…ication_options:991)
at HTMLDocument.dispatch (VM1826 jquery.min.js:3)
at HTMLDocument.r.handle (VM1826 jquery.min.js:3)
(anonymous) @ ucp.php?i=ucp_notifi…ication_options:991
dispatch @ VM1826 jquery.min.js:3
r.handle @ VM1826 jquery.min.js:3

Re: iFrame Forum/WP error

Posted: Sat Feb 09, 2019 10:32 am
by axew3
if not wrong, on actual v3 js code, the unique line that contain this instruction is:

Code: Select all

if ( href.charAt(0) == '#' ){
and if the case, i've not check this, so i've not i've not understand the issue at moment and on what code you get in this: but so the it should just be in case:

Code: Select all

if ( typeof href !== 'undefined' && href.charAt(0) == '#' ){
while on latest mChat code, this code nor exist.
What code are you using?

What action/link you click to have this result?

Code mChat: viewtopic.php?f=2&t=904#p3397
Code v3 iframe: https://www.axew3.com/w3/2018/12/phpbb- ... iframe-v3/

Re: iFrame Forum/WP error

Posted: Sun Feb 10, 2019 2:06 am
by xray
Looks like this is a browser specific issue with push notifications within iFrame.

Re: iFrame Forum/WP error

Posted: Sun Feb 10, 2019 7:28 am
by axew3
i now remember what this line has been changed in
it is now:

Code: Select all

// check for # short links like on FAQ page
if ( href.charAt(0) == '#' ){
 return;
}
the code line was in the way you report above, but it has been changed and reduced to this to be ok for any link like these (#).

The mChat code and css, has been moved to a separated file: so it can be changed to whatever needed, under any aspect, JS and/or CSS with easy. I will try to throw out the new plugin version within today if possible

Re: iFrame Forum/WP error

Posted: Sun Feb 10, 2019 9:29 pm
by xray
ok, that error is removed and this one pop-ups

Code: Select all

Uncaught TypeError: parent.w3all_ajaxup_from_phpbb is not a function
    at window.onload (mchat:1525)
window.onload @ mchat:1525
load (async)
(anonymous) @ mchat:1515

Re: iFrame Forum/WP error

Posted: Tue Feb 12, 2019 2:37 pm
by axew3
ok, sorry little delay ... in trouble with an account swap into a site, that make me crazy between siteground cache and more mess ... wow ... last time i was feeling like a stupid, This time i'm feeling lost in the fog like a stupid ahahah ( but it's my birthday :o ... so it's ok )

this error can be resolved (also) in this way:

Code: Select all

if(parent.location.href.indexOf(wordpress_url_page_forum) > -1){
parent.w3all_ajaxup_from_phpbb(w3appendevents); 
}
the code not need to execute when not in page forum, because the js function
w3all_ajaxup_from_phpbb
come out on wp header html output, only on page forum (with code as is)

but the call to this function is done within overall_footer.html of phpBB, which is called on mchat instances, all over wp if mchat active, also when you're not on page forum.

little delay on releasing new plugin version.
I see any time something to add or improve and not going to the clue due to some other issue that come out maybe into a site i'm following.
Sorry again guys, doing my best in this little trouble days!

Just report, we'll fix!