[3.0] Theme split (wave 4, part 11) — describe the posting form's checkboxes instead of writing them out - #9428
Merged
live627 merged 1 commit intoAug 9, 2026
Conversation
…y hand The eight checkboxes under the editor were eight ternaries building HTML by string concatenation inside the template, which is where the "Move this topic" box picked up a stray quote: value="1"' . (!empty(Utils::$context['move']) ? ' checked" ' : '') . '> so it emitted `checked"=""`, an attribute called `checked"`, and the box never came up ticked even when you reached the form through a link that asked for it. Post::setupPostOptions() now describes them as data and template_post_options() draws them. Anything an option needs to be able to switch back off lists its "off" value under 'hidden', because an unticked checkbox submits nothing at all and the hidden field of the same name is what carries the zero. The collapsible wrapper becomes a details element. That drops the smc_Toggle call and the generated script that went with it, and the disclosure triangle then works with the keyboard and without JavaScript; the small listener that is left only copies the open state into the additional_options field so the next form comes back the same way round. The checkbox list is a two column grid rather than two floated columns, so the overrides that undid the floats for RTL and for narrow screens are gone as well. While it was there, #post_additional_options .progress_bar went too: the attachment progress bars it names sit above that wrapper, never inside it. Verified by serialising the whole posting form on release-3.0 and on this branch, for a new topic, a reply, a modify and a move: the submitted names and values are identical apart from seqnum, which is per request, and move=1, which is the bug above. Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com> Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
live627
approved these changes
Aug 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of the #7933 split (wave 4, part 11). Posting area, and the first of two
slices that are small enough to stand on their own.
The eight checkboxes under the editor were eight ternaries concatenating HTML
inside the template.
Post::setupPostOptions()now describes them as data andtemplate_post_options()draws them, and the collapsible wrapper becomes a<details>element instead of ansmc_Toggleand its generated script.A bug falls out of it. "Move this topic" carried a stray quote:
so it emitted an attribute called
checked"and the box never came up ticked,even when you reached the form through a link asking for it:
release-3.0<input … value="1" checked"=""><input … value="1" checked="">.checkedfalsetruemove=1Hidden "off" fields. An unticked checkbox submits nothing at all, so
anything that can be switched back off needs a hidden field of the same name
carrying the zero ahead of it. That is what
'hidden'is for in each entry, andit is why
notify=0,lock=0,sticky=0andmove=0are listed explicitlyrather than left out.
On
<details>. It drops thesmc_Togglecall and about 25 lines ofgenerated script, and the disclosure triangle then works with a keyboard and
without JavaScript. The small listener that is left only copies the open state
into the
additional_optionsfield, so the next form comes back the same wayround. The list itself is a two column grid rather than two floated columns, so
the RTL and narrow screen rules that undid the floats are gone too. While it was
there,
#post_additional_options .progress_barwent as well: the attachmentprogress bars it names sit above that wrapper, never inside it.
Naming. #7933 renders this list as
<ul id="additional_options">, whichcollides with the hidden
<input id="additional_options">further down the sameform. The
<ul>comes first in document order, sogetElementByIdreturns itand the open state stops persisting. It is
#post_optionshere instead. Worthaligning when the rest of that branch lands.
Testing
The whole posting form was serialised on
release-3.0and on this branch for anew topic, a reply, a modify and a move. The submitted names and values are
identical apart from
seqnum, which is per request, andmove=1, which is thebug above. Toggling the details element was checked to move the hidden field
between
1and0, and to leave the list hidden when closed.Issues References (Fixes|Related|Closes)
Related to #7933