List email plugin, the popup windows appears to be empty sometimes

Status
Not open for further replies.

Borox

Member
Hi,

When I hit the email button the first time, the popup shows up:
upload_2016-9-6_12-30-9.png

But if I try another time right after having closed the previous window, it displays:
upload_2016-9-6_12-31-24.png
No matter how many times you try to close/open, nothing appears on the windows.

We can get the normal windows by resizing the window ( or by refreshing the page):
upload_2016-9-6_12-39-58.png

Thanks.
 
Just saw that:
After resizing the windows the content appears but the window doesn't 'work', for example we can't pick a name in the list of recipient address ( the add button doesn't do anything).
 
Hi Hugh,

I added the site in my profile details.

If you want to see the page, you can go there: /index.php/collaborer/evenements/travaux-non-termines

Thanks
 
It seems to be your Piwik tracking plugin, which is inserting a script inline the popup, and erroring out when the piwik.js then tries to call JSON2.stringify().

If I disable that plugin, everything seems to work fine.

I think the only solution would be to hack on their plugin, so it doesn't try and insert that script if format is not html. As-is, it's probably going to mess with all of our popups.

-- hugh
 
I haven't installed it, but I downloaded what looks like the latest version. If you edit ./plugins/system/piwik/piwik.php, and edit the main onAfterRender function to add the lines of code as commented ...

Code:
    function onAfterRender()
    {
        $mainframe = JFACTORY::getApplication();

        // $$$ start hugh - add this
        if ($mainframe->input->get('format', 'html') !== 'html')
        {
            return true;
        }
        // $$$ end hugh
       
        if($mainframe->isAdmin() || strpos($_SERVER["PHP_SELF"], "index.php") === false)
        {
            return;
        }

        $piwik = $this->params->get('tcode', '');
       
        $buffer = JResponse::getBody();

        $pos = strrpos($buffer, "</body>");


        if($pos > 0)
        {
            $buffer = substr($buffer, 0, $pos).$piwik.substr($buffer, $pos);

            JResponse::setBody($buffer);
        }

        return true;
       
       
    }

That should prevent it from inserting scripts into popups, or other non HTML formats (like JSON, etc).

-- hugh
 
(Some background for anyone stumbling across this thread)

We run into this a lot. There's a whole bunch of 3rd party system plugins that insert JavaScript into the body of pages, which don't check to make sure that the view being requested is "format=html" (which is implicit if an &format=foo is not appended to the URL). And that breaks pretty much any request that isn't a straight up HTML page request, like AJAX calls, or raw formats, etc.

In this case, Fabrik has a special format, 'partial', which we use for our popups, which returns a fully formatted document, with HEAD and BODY, but removes any JavaScript files from the HEAD which were already included on the main page, to avoid the issues double inclusion of things like jQuery raises.
And also doesn't tolerate having main page specific code inserted into them. :)

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top