Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-10-15 21:18:34

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Never seen this popup before ... !?

Saving this specific article gives a popup I’ve never seen before > screenshot

“ … please try again later.” … !?

What’s happening here?

[edit]
The article has several scripts to make appointments e.g. >

<script charset=“UTF-8” src=“https://zhonghetang.libersy.com/regular/services.js?_=149&service_id=896703377&button=true&button_image=small_rounded_red”></script>

Is it possible that Txp 4.6.2 has some safety checks working on this kind of scripts? Older versions of Txp didn’t bother …

Last edited by RedFox (2017-10-16 07:58:57)

Offline

#2 2017-10-19 15:17:16

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

Is this popup known? It is Textpattern related, isn’t it?

Last edited by RedFox (2017-10-19 15:17:31)

Offline

#3 2017-10-19 15:34:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Never seen this popup before ... !?

It’s Txp that’s throwing the error but it might be due to a plugin or script as you say.

If you put the site in Debugging mode, do you get any more info that might give us a clue what’s triggering it? Anything in the browser’s JavaScript console/inspector?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2017-10-19 16:23:34

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

Thanks Bloke. This doc on Google Drive shows the output of the debugging mode. In the console nothing special.

When I switch Txp to ‘live’ mode it shows this text (you can click on the image for an enlargement) >

Last edited by RedFox (2017-10-19 16:32:35)

Offline

#5 2017-10-19 16:47:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,273
Website GitHub

Re: Never seen this popup before ... !?

The Trace log won’t necessarily be much help because that’s the state of the page when it loaded, not after you (AJAX) saved the article, which is where the error occurred. The JavaScript console might give more away though, as that (the Console or Network panel) shows what happens when you submit the request.

As for the Prefs: weird. “A non well formed numeric value encountered” sounds like a value in your database is set to text when the field expects a number. But quite where that is in your prefs table might require combing through it.

Last edited by Bloke (2017-10-19 16:48:13)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2017-10-19 17:07:01

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

In the console >

I don’t know what it means … but nevertheless that … the font (see ZHŌNGTÁNG) is loaded. BTW … this JS error (!) pops up on every page … not only on the page with the appointment scripts … which Txp can’t save … !?

Last edited by RedFox (2017-10-19 17:07:49)

Offline

#7 2017-10-19 17:45:04

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Never seen this popup before ... !?

If you are on php 7.1, this is a possible explanation. Line 819 of txp_prefs.php trying to multiply e.g. 2M by 1024 is (?) generating a warning in php 7.1+…

Offline

#8 2017-10-19 18:52:28

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

etc wrote #307469:

If you are on php 7.1

Hi Oleg … I’m on “PHP version: 7.1.10” … so now what? Tweak the txp_prefs.php?

/**
 * Gets the maximum allowed file upload size.
 *
 * Computes the maximum acceptable file size to the application if the
 * user-selected value is larger than the maximum allowed by the current PHP
 * configuration.
 *
 * @param  int $user_max Desired upload size supplied by the administrator
 * @return int Actual value; the lower of user-supplied value or system-defined value
 */

function real_max_upload_size($user_max)
{
    // The minimum of the candidates, is the real max. possible size
    $candidates = array($user_max,
                        ini_get('post_max_size'),
                        ini_get('upload_max_filesize'), );
    $real_max = null;
    foreach ($candidates as $item) {
        $val = trim($item);
        $modifier = strtolower(substr($val, -1));
        switch ($modifier) {
            // The 'G' modifier is available since PHP 5.1.0
            case 'g':
                $val *= 1024;
            case 'm':
                $val *= 1024; // line 891
            case 'k':
                $val *= 1024;
        }
        if ($val > 1) {
            if (is_null($real_max)) {
                $real_max = $val;
            } elseif ($val < $real_max) {
                $real_max = $val;
            }
        }
    }

    return $real_max;
}

Or maybe by downgrading PHP to 7.0.x …

[edit]
PHP 7.0 installed … no error anymore … :)) … thanks Bloke and Oleg for giving me feedback. The only thing now is line 891 in txp_prefs.php … :|

Last edited by RedFox (2017-10-19 19:14:09)

Offline

#9 2017-10-19 19:15:16

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Never seen this popup before ... !?

No, downgrading is not our method. If you can, try to replace lines 812—813 of txp_prefs.php, we’ll have to patch it anyway:

        $val = floatval($item);
        $modifier = strtolower(substr(trim($item), -1));

Offline

#10 2017-10-19 19:30:12

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

Oleg … I’ve tried, but that adjustment doesn’t work … :o

Offline

#11 2017-10-19 21:23:13

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: Never seen this popup before ... !?

Joop, try harder, it worked for me :-) I had to install php 7.1.10 and a fresh txp 4.7, now have no pages/forms at all… themes branch landing?

Offline

#12 2017-10-20 07:17:34

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: Never seen this popup before ... !?

etc wrote #307475:

and a fresh txp 4.7 …

I did bookmarked it once, but I can’t find 4.7 dev anymore … !?

Offline

Board footer

Powered by FluxBB