Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-02-28 12:11:41

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

error_default template sometimes doesn't fetch a txp:output_form?

Continuing form the file_download issues:

This url currently returns a 404 page: https://emps.l-c-n.com/file_download/32/phw_sandspace4.7b.zip.
However the page lacks any styling (the stylesheet is called inside <txp:output_form form="pw_head" />)

Weirdly, the mirror site running on localhost has no problems.

But this: https://emps.l-c-n.com/foo returns a 404 with the stylesheet and everything.

(hmm and while testing I noticed that Firefox is messing with my SVG files…)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#2 2018-02-28 12:16:59

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

Re: error_default template sometimes doesn't fetch a txp:output_form?

Is this theme related? i.e. is it trying to render the error_default page from your working theme and not finding it, hence the 404?

When you view the mirror site (not logged in, or using the same theme as defined in your Sections panel) that should render the correct theme. Same with the emps.l-c-n.com domain in a private browsing session, I would hope.


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

#3 2018-02-28 12:35:23

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: error_default template sometimes doesn't fetch a txp:output_form?

Bloke wrote #309511:

Is this theme related? i.e. is it trying to render the error_default page from your working theme and not finding it, hence the 404?

Only one theme installed/available on the live server. Nothing from the <txp:output_form /> is outputted.

When you view the mirror site (not logged in, or using the same theme as defined in your Sections panel) that should render the correct theme. Same with the emps.l-c-n.com domain in a private browsing session, I would hope.

However I turn it (various browsers, private mode) I cannot reproduce it on localhost. These are exactly the same files, currently. On localhost I’m up to date with /dev/, the live servers bit behind. Will update tomorrow

(maybe I should omit that form completely for error pages, would save a millisecond or so…)

On the live server, in debug mode (both forms do exist, they are used all over the site). And it is only for /file_download/ URLs.

General error Notice: Undefined index: skin on line 5260
textpattern/publish.php:558 txp_die()
index.php:116 textpattern()
Tag error: <txp:output_form form="pw_head" /> ->  Notice: Undefined index: skin while parsing form None on page None
textpattern/lib/txplib_misc.php:4331 fetch_form()
textpattern/publish/taghandlers.php:466 parse_form()
output_form()
textpattern/vendors/Textpattern/Tag/Registry.php:116 call_user_func()
textpattern/lib/txplib_publish.php:596 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:520 processTags()
textpattern/lib/txplib_misc.php:5299 parse()
textpattern/publish.php:558 txp_die()
index.php:116 textpattern()
Tag error: <txp:output_form form="pw_head" /> ->  Textpattern Notice: Form not found. pw_head while parsing form None on page None
textpattern/lib/txplib_misc.php:4297 trigger_error()
textpattern/lib/txplib_misc.php:4331 fetch_form()
textpattern/publish/taghandlers.php:466 parse_form()
output_form()
textpattern/vendors/Textpattern/Tag/Registry.php:116 call_user_func()
textpattern/lib/txplib_publish.php:596 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:520 processTags()
textpattern/lib/txplib_misc.php:5299 parse()
textpattern/publish.php:558 txp_die()
index.php:116 textpattern()
Tag error: <txp:output_form form="pw_header" /> ->  Notice: Undefined index: skin while parsing form None on page None
textpattern/lib/txplib_misc.php:4331 fetch_form()
textpattern/publish/taghandlers.php:466 parse_form()
output_form()
textpattern/vendors/Textpattern/Tag/Registry.php:116 call_user_func()
textpattern/lib/txplib_publish.php:596 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:520 processTags()
textpattern/lib/txplib_misc.php:5299 parse()
textpattern/publish.php:558 txp_die()
index.php:116 textpattern()
Tag error: <txp:output_form form="pw_header" /> ->  Textpattern Notice: Form not found. pw_header while parsing form None on page None
textpattern/lib/txplib_misc.php:4297 trigger_error()
textpattern/lib/txplib_misc.php:4331 fetch_form()
textpattern/publish/taghandlers.php:466 parse_form()
output_form()
textpattern/vendors/Textpattern/Tag/Registry.php:116 call_user_func()
textpattern/lib/txplib_publish.php:596 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:520 processTags()
textpattern/lib/txplib_misc.php:5299 parse()
textpattern/publish.php:558 txp_die()
index.php:116 textpattern()

Last edited by phiw13 (2018-02-28 12:35:54)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#4 2018-02-28 12:54:01

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

Re: error_default template sometimes doesn't fetch a txp:output_form?

Aside from the fact the theme is not set if loading a stylesheet (didn’t we introduce a stylesheet parsing option, Oleg?) we also need to ensure it’s set for file downloads, as it jumps out after detecting one of those.

We could maybe add defensive code around all uses of $pretext['skin'], or ensure it’s always set in publish.php.


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

#5 2018-02-28 13:11:24

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

Re: error_default template sometimes doesn't fetch a txp:output_form?

Bloke wrote #309517:

Aside from the fact the theme is not set if loading a stylesheet (didn’t we introduce a stylesheet parsing option, Oleg?) we also need to ensure it’s set for file downloads, as it jumps out after detecting one of those.

We could maybe add defensive code around all uses of $pretext['skin'], or ensure it’s always set in publish.php.

Stylesheet parsing is a hidden option disabled by default atm, but yes, the issue needs to be fixed. I can attempt a fix later today if you want.

Offline

#6 2018-02-28 13:32:32

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

Re: error_default template sometimes doesn't fetch a txp:output_form?

etc wrote #309518:

Stylesheet parsing is a hidden option disabled by default atm, but yes, the issue needs to be fixed. I can attempt a fix later today if you want.

That’d be ace, thanks.


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

#7 2018-02-28 23:26:59

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,192
Website

Re: error_default template sometimes doesn't fetch a txp:output_form?

OK, after GIT updating both locally and on the live server, the 404 page now loads correctly for incorrect/missing file_download URLs.

Thanks both Oleg and Stef.

Test URL: emps.l-c-n.com/file_download/36 (that file does not exist)


PS – in the OP I mentioned that Firefox was messing up my SVG files. Reason: strict Content Security Policy. The SVG files contain a <style /> block and Firefox was strict in not allowing it. Solution: loosen a bit the CSP policy by allowing inline styling (style-src 'self' 'unsafe-inline';). Safari / Chrome / Edge seem less strict.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB