Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2018-03-21 10:54:05

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

The point is, during export (for example) you are told whether anything is amiss. If you choose to ignore that information and immediately wipe-import, well, your funeral… right?


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

#14 2018-03-21 11:05:13

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

Bloke wrote #310185:

The point is, during export (for example) you are told whether anything is amiss. If you choose to ignore that information and immediately wipe-import, well, your funeral… right?

Right, I have tested.

Offline

#15 2018-03-21 11:10:57

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

Sorry, I sometimes forget the forum…

  • Import (sync.): import valid template files (then, delete all extra templates);
  • Export (sync.): export valid template files (then, delete extra valid templates files);
  • Delete (sync): delete valid template files.

The weird things that the regex introduce are the following

  • on import a file violating the naming convention would not be considered as a valid template file and would not be imported but no warning would be displayed neither. It could probably be enhanced.
  • the sync. process remove extra templates from the DB even if they violate the naming convention while it does not remove files violating this convention as they are not considered as valid templates.

Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#16 2018-03-21 11:16:16

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

Thanks for the clarification. Are these major issues? Probably not in 80%+ of use cases.

As we look at webhook/direct file access, we can consider such corner cases over the next week after beta.2 is released and see if there’s anything we need to do in this regard.


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

#17 2018-03-21 11:32:49

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

Bloke wrote #310189:

Are these major issues? Probably not in 80%+ of use cases.

I’d say this is an issue as soon as you have an unconventionally named form. You export the db template, get a warning, work on the flat copy for few days, forget about the warning, reimport the theme to db — the form is gone. Dunno what to do, though.

Offline

#18 2018-03-21 11:36:04

Summer
Member
Registered: 2018-01-29
Posts: 60

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

Thank everyone, I understand

Offline

#19 2018-03-21 12:34:25

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

etc wrote #310191:

I’d say this is an issue as soon as you have an unconventionally named form. You export the db template, get a warning, work on the flat copy for few days, forget about the warning, reimport the theme to db — the form is gone. Dunno what to do, though.

At one in point in the recent past, not sure if here in the forum or on Github, there was a conversation about adding an informative message below the name form or page templates, or issuing a warning when saving the form with “disallowed” characters in the name.


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

Offline

#20 2018-03-21 12:46:15

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

phiw13 wrote #310194:

At one in point in the recent past, not sure if here in the forum or on Github, there was a conversation about adding an informative message below the name form or page templates, or issuing a warning when saving the form with “disallowed” characters in the name.

I’ve seen few live sites with those “invalid” form names, it’s too late to warn their authors (and restrictive too). We should find a way to convert any string to some fs-safe version (unicode? something else?). Or don’t touch such forms at all. Or decompose “synchronize” option in two more verbose steps: delete + import.

Offline

#21 2018-03-21 12:55:00

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

The regex was inherited from Gocom’s rah_flat. Could we just remove it (or make it consistent with the DB related naming conventions)? If a file fail to be written, it should display a warning anyway. Then, nothing more we can do I guess.

Last edited by NicolasGraph (2018-03-21 12:55:30)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#22 2018-03-21 14:15:27

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

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

NicolasGraph wrote #310196:

The regex was inherited from Gocom’s rah_flat. Could we just remove it (or make it consistent with the DB related naming conventions)? If a file fail to be written, it should display a warning anyway. Then, nothing more we can do I guess.

No, I’m afraid, a file could be written to a wrong directory if the name contains / or . or something else as weird. I feel that this sync options should be off by default and not memorized, until we find a solution.

Offline

#23 2018-03-21 14:20:23

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [TXP v4.7+] When a theme is stored in the database, will it lose data?

etc wrote #310202:

No, I’m afraid, a file could be written to a wrong directory if the name contains / or . or something else as weird.

/ is not allowed in names but . is, you’re right.

I feel that this sync options should be off by default and not memorized, until we find a solution.

It seems reasonable.

Last edited by NicolasGraph (2018-03-21 14:21:34)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB