Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2020-02-15 17:26:51

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,386
Website GitHub Mastodon Twitter

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

A second issue. When using

<img src="<txp:page_url type="theme_path" />/forms/svg/graphic.svg" alt="my graphic" class="my classes" />

in the write tab, I get a broken image returned. Writing the url, the image loads fine.

> Edited to add that

<img src="<txp:output_form form="graphic.svg" format="flat.url" />" alt="my graphic" class="my classes" />

also works OK but I’m not certain as to how this may affect theme development.

Last edited by colak (2020-02-15 17:41:59)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#17 2020-02-15 21:53:56

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

colak wrote #321681:

<txp:php>echo safe_count('txp_image', "category = 'publications'");</txp:php>... … prevents the page from loading.

Not on the demo server. If I create that category and randomly assign some of the images to it, I get the correct value returned in the article. Is there something else on the page interfering? Does your source code or tag trace reveal anything?

<img src="<txp:page_url type="theme_path" />/forms/svg/graphic.svg" alt="my graphic" class="my classes" />... in the write tab, I get a broken image returned.

It’s a Textile parsing thing. It’s the same in 4.7.3, not a regression. I also get the same broken output on 4.7.3 and 4.8.0-beta.3 if I use <txp:output_form> as in your second example. It messes the double quotes up. You have to surround it with == to make it work.

This is a prime example why shortcodes are so much better for use in articles than tags in attributes :) Shorter and leaner tags, less prone to breakage, and you can control the output centrally in the Form.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#18 2020-02-15 22:01:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

jakob wrote #321678:

Given that DO is fairly popular and a generally respected hosting option, might it make sense to trap this error more elegantly? Or allow one to proceed if not vital?

Possibly. We’ll have to see what the fallout is to return nothing from the XML routines if their sys requirements aren’t met. For production usage (i.e. upgrades) I expect the worst case scenario might be that the pophelp topics return nothing when clicked, since they’re read from XML files.

For new installations, well, it’s more vital since default content such as categories and the welcome article and sections and so forth are read from XML files. So, as Pete and Jools say, it makes sense to try and trap that early on. Should be relatively easy to do. Maybe we don’t display the language selector at all. Just the welcome message/header and then an “Unfortunately your system doesn’t meet the base requirements to run Textpattern. Please ensure you enable: blah, blah and blah, then refresh this page.”

That would probably be more useful than a bunch of manky error messages.

We already have an assert_system_requirements() function that runs on:

  • Setup
  • Update

but it only checks the PHP version. We could maybe expand that to include other peripheral functionality that we consider vital.

EDIT: My 9000th post, woohoo!

Last edited by Bloke (2020-02-15 22:12:02)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#19 2020-02-16 12:48:35

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,649
Website

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Upgrading instructions may need a little tweak, for people who upgrade from a previous 4.8 beta, and in particular for people who run TXP on servers where the /textpattern/plugins folder need special permissions. If that folder already exists, there is no need to overwrite it. This probably would, depending on how the upgrade is performed, erase all its contents (and reset the permissions to the default).

In the future this will apply to everyone who upgrade.


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

Offline

#20 2020-02-16 14:08:12

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,733
GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

I ran some tests on a Canonical-provided Ubuntu ISO (bionic, 18.04 LTS branch) on a fresh install. Standard setup, with a LAMP stack via the installer, no extra packages from apt, just an apt full-upgrade to get up-to-date.

Findings for current apt PHP (v 7.2.24):

  • There is no SimpleXML support out of the box.
  • There is libxml support (v 2.9.4)
  • There is no is JSON support out of the box.
  • There is mysqli support out of the box.

So we should probably update the sys reqs article to indicate not all PHP installations have all the parts ready to go.

Last edited by gaekwad (2020-02-17 17:50:16)

Offline

#21 2020-02-16 15:30:03

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,386
Website GitHub Mastodon Twitter

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321683:

Not on the demo server. If I create that category and randomly assign some of the images to it, I get the correct value returned in the article. Is there something else on the page interfering? Does your source code or tag trace reveal anything?

Hi Stef, There is a number of article counters. Unfortunately I cannot get a tag trace when the error occurs as it breaks the whole page. The error is the only thing that loads. I’ll investigate further.

> Edit. When <txp:php>echo safe_count('txp_image', "category = 'publications'");</txp:php> is used without the surrounding equals the page does indeed break on the b3 demo site too. The issue is of course minor as the solution is already in the box. I nevertheless hoped that txp’s reaction would not be as radical.

Last edited by colak (2020-02-16 16:21:01)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#22 2020-02-16 16:24:48

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

phiw13 wrote #321685:

Upgrading instructions may need a little tweak.

Yep. When 4.8 is out, we’ll do that.

gaekwad wrote #321686:

We should probably update the sys reqs article to indicate not all PHP installations have all the parts ready to go.

Definitely. If there’s no JSON support as well, people without that and simplexml are going to struggle. We need to trap those and deal with them as best we can. Thanks for testing.

If I get a chance, I’ll try and trap some of this stuff in a few commits today or tomorrow. If you have time and can rerun some tests in environments without those components, it’d be awesome so we can squash this.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#23 2020-02-17 08:56:38

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,733
GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321688:

If I get a chance, I’ll try and trap some of this stuff in a few commits today or tomorrow. If you have time and can rerun some tests in environments without those components, it’d be awesome so we can squash this.

Yep, happy to.

Offline

#24 2020-02-17 10:47:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,204
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321684:

My 9000th post, woohoo!

Wow, you are hands down the “Hamilton” or “Liverpool” of Textpattern :-) I think I post a lot and I’m not even half-way behind you*. Props!!

*In fact, I’m currently only just in the top ten according to forum search.


TXP Builders – finely-crafted code, design and txp

Offline

#25 2020-02-17 11:41:12

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,386
Website GitHub Mastodon Twitter

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321684:

EDIT: My 9000th post, woohoo!

And it’s not just the quantity. It’s the quality too! Way to go.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#26 2020-02-17 15:31:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321688:

If I get a chance, I’ll try and trap some of this stuff in a few commits today or tomorrow.

Daft question perhaps. Is there a way of temporarily disabling a library, either via a line in php.ini or by moving/renaming folders in MAMP’s installation path? Just want to ‘disable’ libxml to see what happens but I don’t want to recompile from source or anything that drastic. Wondered if there was a quick hack to nobble the library so that when I restart MAMP it’s not included. Easier to test that way.


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#27 2020-02-17 15:41:54

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,733
GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321711:

[…] MAMP […]

Doesn’t MAMP use the underlying macOS internals? Please forgive me if this comes over as obnoxious, but surely a VM of a proper hosting environment OS would be more useful? If you combine this with snapshots, it’s relatively quick to purge the system library without knackering the host.

So, in the case of Ubuntu LTS, spin up a VM from the mini.iso netboot image, configure stack(s) to taste in the installer, let it get its stuff, you’re ready to go. Power off, snapshot. Power on, apt purge libxml, power off, snapshot.

Actually, I do sound obnoxious. Ugh.

Offline

#28 2020-02-17 15:59:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

gaekwad wrote #321712:

Doesn’t MAMP use the underlying macOS internals?

Maybe. I know you can configure which version(s) of PHP are available by hacking the /Applications/MAMP/bin/php directory and ‘commenting out’ versions you don’t want. Since it defaults to the latest two versions of PHP 7 but ships with a bunch of other versions, if you wanted, say, the latest PHP 7 and an older PHP 5.6 to be available, I can just rename all the other dirs, turn off the server, pick the one I want from prefs, and restart the server.

Just wondered if maybe the entire library ecosystem was self-contained in there too and it was possible to use similar trickery to dick around with the filesystem and ‘shut off’ certain components for testing purposes. Or maybe an override in php.ini I didn’t know about, like commenting out a load_module line or adding a disable_module line or something.

I could go the route you suggested and fire up VirtualBox but I’d have to then install Txp in there as well and set up MySQL DBs and such-like. Since I already have all that paraphernalia available on localhost, I was looking for a shortcut! No worries, thanks for the alternative setup ideas.

Last edited by Bloke (2020-02-17 16:02:36)


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#29 2020-02-17 16:56:46

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,457
Website GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

gaekwad wrote #321686:

There is no JSON support out of the box.

Wait, so that means the json_encode() function is missing?


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

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#30 2020-02-17 16:59:24

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,733
GitHub

Re: Feedback to: Textpattern CMS 4.8.0-beta.3 released

Bloke wrote #321714:

Wait, so that means the json_encode() function is missing?

What can I do here to test that?

Offline

Board footer

Powered by FluxBB