Replies: 10 comments
|
@tomfuller2 are we going to do this? Not sure this will be helpful if they have migrated on 9.0.1? |
|
@tomfuller2 Not sure we can do this. More so this will be documentation more than code works. |
|
@tomfuller2 we could ask people to export their templates but this would be something if they used custom template_fils |
|
I feel like this is already possible. I’ll check it out. |
|
Yes I think it is possible now also. We could create multiple versions of a
template that they could use. We also need to document CSS usage system.
And a template repository for them to pull from. Like the idea.
On Sat, Mar 6, 2021 at 4:46 PM Tom Fuller ***@***.***> wrote:
I feel like this is already possible. I’ll check it out.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#540 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHSXU33IDID2Z77AI2MDH3TCKWD3ANCNFSM4BANECZA>
.
--
Sent from Gmail Mobile
|
|
Picking this up eleven years later, because the answer changed: the idea is still good, but the mechanism proposed here is now the reason to build it differently. First, the 2015 plan no longer has a working partThe proposal was "with template → export we can easily generate this files". That export is broken on every current install. Two more reasons not to build on that pair:
What a preset actually is nowA template today is one row whose That also settles a question from further up the thread: presets should carry zero ProposalStorage — {
"name": "Classic Table",
"description": "Dense table listing — closest to a BS8/BS9 table layout.",
"author": "CWM Team",
"version": "1.0",
"minProclaim": "10.5.10",
"thumbnail": "classic-table.png",
"params": { }
}Apply — a New from preset button on the Templates list opens a picker and creates a new template row, reusing the shape of Whitelist, two gates. Bind the preset through
Any of those carried in a preset either breaks on the target site or leaks the source site's structure. Versioning — presets carry a Export as preset (JSON) — this is what makes @st-anton's original offer work. "You and I provide a template each" becomes: configure a template, export JSON, open a PR adding it to The test that has to be writtenThe obvious check — "preset applied, row created, no errors" — passes while params silently vanish. So acceptance is a round-trip params diff: fully configure a template, export it as a preset, apply it as a new template, diff the two registries. Any key present before and absent after is a missing declaration. Anything weaker cannot tell success from silent loss. StagingPhase 1 is the above — bundled presets, apply-as-new, JSON export. Self-contained. Phase 2 is @bcordis's 2021 "template repository for them to pull from". That one is remote fetch, so it carries new SSRF and supply-chain surface and wants its own review. Deliberately kept separate. One thing this does not solve@st-anton's actual complaint was that migration overwrote an existing template — one that menu items already point at. New from preset gives a good starting point but leaves those users repointing menus by hand. Going with new-row-only for now; if that pain turns out to be real once presets are in use, an apply-to-existing action with a confirm and a snapshot of the prior params can follow as its own change. |
|
Addendum after reading #1179, which turns out to be load-bearing here in a way that changes two things above. #1179 removes the main risk I flaggedI said the dangerous failure mode is silent param loss: #1179's proposed storage — a single The round-trip params diff is still the right acceptance test, but afterwards it guards a much smaller surface. So the sequencing is a real decisionA preset is a serialised copy of the params format. #1179 changes that format, and is scoped as a v11.0 breaking change. That gives two options:
The second is only cheap because #1179 commits to that back-compat converter. If #1179 ever drops the legacy-read path, 10.x-era presets become dead files, so whichever way this goes the two should be decided together rather than separately. My inclination is presets-after-#1179 — the whole value of a preset is that it is a stable artefact people trade and contribute, and minting a format we already know we are about to break is the one thing that undermines that. But it does mean migrators get nothing until v11. Unchanged by thisThe rest stands: params-only, no The broken SQL exporter is now filed as #1918. It turned out to be more interesting than a dead reference — |
|
Correction to my previous comment. I said #1918's export bug was fatal on clean installs but "works fine on sites upgraded from the 10.0.0 baseline", inferring a lineage split from the fact that no update SQL file drops That inference was wrong. Proclaim drops those columns from PHP, not SQL: So there is no lineage split. The column is gone everywhere, the removal was deliberate and correct, and only the exporter is stale — which makes the bug simpler and more uniform than I described, not less severe. #1918 has been rewritten accordingly, and my "add idempotent DROPs so upgraded sites converge" suggestion is withdrawn; that work already exists. Nothing in the preset design depends on this. The reasons not to build distribution on the SQL export path — the arbitrary-SQL import sink, and MySQL-only |
Decision recorded: the importer is replaced, not repaired — and no former format is acceptedFollowing on from the comments above and #1925 / #1926. The direction is a clean break. The hard requirement on the replacement is that it never executes uploaded content. The current importer splits an upload on Two findings that make this materially easier than it looked
So a shared template needs to carry a layout selector, never code. That removes most of the reason the old format was dangerous. The 2015 goal does not need the exporter at all. A Proclaim template is one row whose That is a small, shippable feature and it does not block on the importer rebuild. Backup/restore was checked as an alternative delivery route and ruled out: it is all-or-nothing across every Proclaim table, so it cannot move one template without flattening messages and teachers too. Suggested split: presets first (closes the original 2015 ask), importer rebuild second (#1926), and it should not be gated behind #1179 — if the params storage format later changes, presets need a data migration, not a rebuild. |
Correction to my comment above: the templatecode PHP is executedI said
Why it matters for this thread specifically. The idea here has always been to distribute reference templates for people to import. With the current mechanism, importing a template file authored by someone else means letting that file's author put PHP in your web root — So the 2015 plan was not merely using a broken exporter; the sharing model it implied is unsafe as long as a shared file can carry template code. The recommendation is unchanged and now better founded. Ship reference designs as params presets — a preset selects a layout that Proclaim already ships and tunes the ~17KB of params around it. A preset cannot introduce code, so the sharing use case this discussion has wanted since 2015 becomes safe by construction rather than by validation. Any future import format must likewise be unable to create or modify a |
Uh oh!
There was an error while loading. Please reload this page.
During a migration, the BS9 templates are overwritten by the BS8 templates. This is not bad, the user has it's settings like format of date, filter settings, comments entry and so on. On the other side, the layout settings are worthless, table rows and columns are no more useful.
Idea: We provide one or two templates as 'reference' to show the user how to set up a layout. With the template -> export we can easily generate this files and put them in /media/com_biblestudy/templates.
@tomfuller2 your template has less 'table' entries, mine has more 'table' entries: You and I provide a template each?
All reactions