Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-08-14 17:13:17

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

size limitation in forms?

After posting this issue with my shortcode and taking a break, I revisited my environment and found that the shortcode is saved up to line 1098, trimming the rest. Note that I could not see this before as the ajax saves did not show that trim. I had to click on the form’s link and basically re-load/visit the page. Is there a size limitation in forms?


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

Offline

#2 2020-08-14 17:21:41

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

Re: size limitation in forms?

Yes. 64KB.

Incidentally, I tried to paste your entire media shortcode into a Form and the Ajax save failed. It’s too darn big! I had to hack out a tonne of it to get it to save.

EIDT: It didn’t truncate it in my case, just refused to save with a red alert message until I’d hacked out enough to get it under the size limit. This leads me to believe that the result of the action may be MySQL/PHP version specific.

Last edited by Bloke (2020-08-14 17:23:14)


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 2020-08-14 17:26:18

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

Re: size limitation in forms?

Bloke wrote #325347:

Yes. 64KB.

Do you think that it will be a very bad idea to increase that to 128KB? Servers are stronger now.

>Edit: I am not suggesting that because of the shorcode as I could easily split it. It is a genuine question.

Last edited by colak (2020-08-14 17:31:29)


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

Offline

#4 2020-08-14 18:10:06

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

Re: size limitation in forms?

The next size up from TEXT is MEDIUMTEXT which is up to 16MB. A big leap!


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 2020-08-15 04:42:14

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

Re: size limitation in forms?

Bloke wrote #325350:

The next size up from TEXT is MEDIUMTEXT which is up to 16MB. A big leap!

That is indeed too much for forms. I had no idea that mysql had this groupings. I thought that the capacities were defined by the devs.


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

Offline

#6 2020-08-15 07:44:28

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

Re: size limitation in forms?

Even 64KB full of tags can be stressing for the parser.

Offline

#7 2020-08-15 08:00:38

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

Re: size limitation in forms?

etc wrote #325356:

Even 64KB full of tags can be stressing for the parser.

Noted! I’ll have to split the codebase.


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

Offline

#8 2020-08-15 08:04:18

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

Re: size limitation in forms?

colak wrote #325360:

I’ll have to split the codebase.

Or somehow modularize it, perhaps?

Offline

#9 2020-08-15 08:17:02

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

Re: size limitation in forms?

etc wrote #325361:

Or somehow modularize it, perhaps?

I started creating variables for the widely used lines of code, but modularising will indeed be much better and it will give me a chance to think about it in a deeper way!


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

Offline

#10 2020-08-15 09:26:38

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

Re: size limitation in forms?

colak wrote #325366:

I started creating variables for the widely used lines of code, but modularising will indeed be much better and it will give me a chance to think about it in a deeper way!

Yes! There’s soooo much duplication in that <txp::media> shortcode. There has to be a way of refactoring it somehow to help the poor parser out. My site’s memory usage went into meltdown when I added a video to it :)


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

#11 2020-08-15 09:49:58

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

Re: size limitation in forms?

Bloke wrote #325369:

Yes! There’s soooo much duplication in that <txp::media> shortcode. There has to be a way of refactoring it somehow to help the poor parser out. My site’s memory usage went into meltdown when I added a video to it :)

Stay tuned for v2 in the next couple of weeks:)


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

Offline

#12 2020-08-15 11:02:37

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

Re: size limitation in forms?

I would expect a good approach might be to process all the variables up-front and use defaults so you can guarantee that they have values. Even if the value is a well-known fake value like “UNAVAILABLE” or something.

That will give you the ability to get rid of a tonne of conditionals in the individual handlers. So you may only need to worry about testing cookies. But even there you can perhaps pre-process them once you know which flavour of content you’re serving? Then it’s just a single <txp:if_variable> test for each content type.

There may be some complexities I haven’t figured as I didn’t quite understand the way you’d set it all up when I was hacking out the bits I didn’t need. But there ought to be a way of making a single template per type (audio, video) or maybe a few types with common elements, and feeding the variables into them.


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

Board footer

Powered by FluxBB