2.1Beta: Infobox when saving a new article is not shown

Found a bug? Tell us!!
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

2.1Beta: Infobox when saving a new article is not shown

Post by MarioH »

I'm using the latest master.zip from github. When saving a new article, the textbox which normaly shows infos like successfuly sent trackbacks (or not) etc is not shown. There is a grey bar instead of the text box.

Regards
Mario
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

Confirmed. I thought it was something on my installation.

Did you see any error message in your log? Mine showed none.

I debugged this already a little bit and got confused. The little grey box is an complete iframe, and it has a body, but that body for me has an id or class mainpane. That's not like that in the 2k11 preview_iframe.tpl. Do you see the same?
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

Additional complication: Updated my devblog to to current master and it works fine there. With 2k11, with timeline – it must be something specific to our installations.
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by MarioH »

The iframe on my blog looks like this:

Code: Select all

<iframe id="serendipity_iframe" width="100%" height="100" frameborder="0" title="Serendipity" scrolling="no" marginheight="0" marginwidth="0" name="serendipity_iframe" src="serendipity_admin.php?serendipity[is_iframe]=true&serendipity[iframe_mode]=save" style="height: 10px; border: 0px none;">
<!DOCTYPE html>
<html class="no-js" lang="de">
<head>
<body class="dserif" style="padding: 0; margin: 0;">
<div id="main" class="clearfix" style="padding: 0; margin: 5px auto; width: 98%;">
<script src="">
</body>
</html>
</iframe>
onli wrote:Additional complication: Updated my devblog to to current master and it works fine there. With 2k11, with timeline – it must be something specific to our installations.
Same here. On abouts9y.org, which runs on another host, the box is working as expected with the latest master.
onli wrote:Did you see any error message in your log?
No errors in the apache logs.

Regards
Mario
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by MarioH »

Oh, Firebug is throwing these three errors.

SyntaxError: expected expression, got '<'
<!doctype html>
http://blog.hommel-net.de/serendipity_a ... mode]=save (Zeile 1)

ReferenceError: Modernizr is not defined
if(Modernizr.indexeddb && true) {
http://blog.hommel-net.de/index.php?/pl ... _editor.js (Zeile 797, Spalte 1)

SyntaxError: expected expression, got '<'
<!doctype html>
http://blog.hommel-net.de/serendipity_a ... mode]=save (Zeile 1)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

It's no wonder the console is showing errors, the generated html is completely broken. It starts the head, only to start the body in it, and then closes the body? That's not what I saw in my installation, but I'll confirm that.

That does not fit at all to https://github.com/s9y/Serendipity/blob ... iframe.tpl. There is not one codepath that could result in body/div/script, also not in https://github.com/s9y/Serendipity/blob ... iframe.tpl.

The only explanation I can find that something is making smarty generate wrong php code out of that template – and that php code then creates this, without generating an error. But I really hope it is something easier.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

Which PHP version are you running in those two installations?
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by MarioH »

onli wrote:It's no wonder the console is showing errors, the generated html is completely broken.
Oh sorry, I didn't copy the complete code:

Code: Select all

<iframe id="serendipity_iframe" width="100%" height="100" frameborder="0" title="Serendipity" scrolling="no" marginheight="0" marginwidth="0" name="serendipity_iframe" src="serendipity_admin.php?serendipity[is_iframe]=true&serendipity[iframe_mode]=save" style="height: 10px; border: 0px none;">
<!DOCTYPE html>
<html class="no-js" lang="de">
<head>
<meta charset="UTF-8">
<title>Serendipity Verwaltungsoberfläche</title>
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="//ajax.googleapis.com" rel="dns-prefetch">
<link href="//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic" rel="stylesheet">
<link href="http://blog.hommel-net.de/serendipity.css?v=1457903774" rel="stylesheet">
<script src="">
<script src="/templates/jquery.js">
<link href="/plugins/serendipity_plugin_twitter/tweeter/serendipity_event_twitter_tweeter.css" type="text/css" rel="stylesheet">
<script src="/plugins/serendipity_plugin_twitter/tweeter/serendipity_event_twitter_tweeter.js" type="text/javascript">
<script src="/templates/2k11/admin/js/plugins.js">
<script src="http://blog.hommel-net.de/index.php?/plugin/admin/serendipity_editor.js">
<script type="text/javascript">
</head>
<body class="dserif" style="padding: 0; margin: 0;">
<div id="main" class="clearfix" style="padding: 0; margin: 5px auto; width: 98%;">
<main id="primary"> </main>
</div>
<script src="">
<!doctype html>
<!--[if IE 8 ]>    <html class="no-js lt-ie9" lang="de"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="de"> <!--<![endif]-->
<head>
    <meta charset="UTF-8">
    <title>Serendipity Verwaltungsoberfläche</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="dns-prefetch" href="//ajax.googleapis.com">
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic">
    <link rel="stylesheet" href="http://blog.hommel-net.de/serendipity.css?v=1457903774">                                
<!--[if lte IE 8]>
    <link rel="stylesheet" href="oldie.css">
<![endif]-->
    <script src=""></script>
    <script src="/templates/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="/plugins/serendipity_plugin_twitter/tweeter/serendipity_event_twitter_tweeter.css" />
<script type="text/javascript" src="/plugins/serendipity_plugin_twitter/tweeter/serendipity_event_twitter_tweeter.js"></script>

    <script src="/templates/2k11/admin/js/plugins.js"></script>
    <script src="http://blog.hommel-net.de/index.php?/plugin/admin/serendipity_editor.js"></script>
<script type="text/javascript">
window.onload = function() {
    parent.document.getElementById('serendipity_iframe').style.height = document.getElementById('main').offsetHeight
                                                                      + parseInt(document.getElementById('main').style.marginTop)
                                                                      + parseInt(document.getElementById('main').style.marginBottom)
                                                                      + 'px';
    parent.document.getElementById('serendipity_iframe').scrolling    = 'no';
    parent.document.getElementById('serendipity_iframe').style.border = 0;
}
</script>
</head>
<body style="padding: 0; margin: 0;" class="dserif">
    <div id="main" class="clearfix" style="padding: 0; margin: 5px auto; width: 98%;">
        <main id="primary">
        
        </main>
    </div>

    <script src=""></script>
</body>
</html>
</script>
</body>
</html>
</iframe>
Maybe there's a problem with the javascript in the body of the iframe (I copied it within the source above)?
onli wrote:Which PHP version are you running in those two installations?
It's 5.6.23 on both hosts.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

Okay, better :)

That is using the next theme. I'll test with that, https://github.com/s9y/Serendipity/blob ... iframe.tpl. There, $preview is not filled – I assume that if not doing a preview, that should hold the messages, though I do not see how that possibly could succeed in showing the view entry link. Maybe that tpl is just broken? And scripts/master.js can't be found, which could be caused by the usual problems in that file of whether to get files from the frontend or the backend.

I made a test in my blog, and it seems that is using the preview_iframe.tpl of the default theme. That shouldn't happen either. Though I can't be sure, it's a pity, https://github.com/s9y/Serendipity/blob ... c.php#L261 is a mess.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

I fixed it for the next theme, https://github.com/s9y/Serendipity/comm ... c781e025a5. The preview_iframe.tpl was just missing the necessary commands to actually show something in that box. Maybe that was a try to simplify that file.

I'll now see why my own theme is broken as well.

*Edit*: No, in the devblog it works fine now. Does it somehow fall back to the next theme, and got fixed as well? I'll apply the patch, and see when I write my next entry. This might have fixed the problem for a lot of themes.
MarioH
Regular
Posts: 238
Joined: Mon Jul 20, 2009 10:53 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by MarioH »

Hm, I changed the file and now i get this:
https://hommel-net.de/owncloud/index.ph ... uLBsF5LFHZ

The box isn't empty anymore but it doesn't fit with the content.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

I think that is something Matthias could solve easier than me. Size issues in iframes is a bit complex. But I'll have a look.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by yellowled »

onli wrote:I think that is something Matthias could solve easier than me. Size issues in iframes is a bit complex.
Not sure how much time I'll have next week (just coming back from vacation, will have a lot of stuff piled up). Someone please poke me if I haven't looked at this soon-ish. (It's probably related to the height of the iframe having to be calculated. Did I mention lately that I think this preview method is stupid?)

YL
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by onli »

In my own blog, the problem is different. I'm using a modified version of codeschmiede – html5, no table layout, stuff like that. The problem with 2.1 – and I really think that only started with the 2.1 beta, not 2.0 – is that it falls back to the preview_iframe of the default-theme, https://github.com/s9y/Serendipity/comm ... iframe.tpl. And this file has the exact same problems the next template had, it is not calling {$updertHooks} and not outputting error mesages.

I don't know where that problem is coming from. Did 2.1 change the fallback mechanism? Is s9y supposed to fallback to default and not to 2k11 here? Garvin, that goes in your direction, you and Ian made changes to getTemplateFile for the wysiwyg editor which could be relevant here, if I remember correctly – that was after I left that particular discussion.

I am not sure what the correct fix would be. Add the missing statements to default/preview_iframe.tpl? Make sure themes fall back to the tpl of 2k11 instead (how? I already set Engine: 2k11. Why isn't that working?)? Somehow move the always needed stuff from the tpl into the core?

*Edit:* Could be https://github.com/s9y/Serendipity/comm ... 4d87697a23

*Edit2:* I now pushed a simplification of the related code, https://github.com/s9y/Serendipity/comm ... e05b843419. This will need some testing – but I think this is the logic from which we should start and workaround problems in other places, like setting Engine: default in themes that need that.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: 2.1Beta: Infobox when saving a new article is not shown

Post by yellowled »

onli wrote:Add the missing statements to default/preview_iframe.tpl? Make sure themes fall back to the tpl of 2k11 instead (how? I already set Engine: 2k11. Why isn't that working?)? Somehow move the always needed stuff from the tpl into the core?
I know you're already aware of this, but to document it: theme authors need to be able to provide a seperate preview_iframe.tpl in most of the cases. Basically, if your theme has its own index.tpl, it will require its own preview_iframe.tpl as well.

The solution to encapsulate the whole preview in a single variable {$preview} still seems the best one for me since it makes it very easy and not prone to error for theme authors, so “move what is always needed to the core” seems best.

YL
Post Reply