Skip to content

[3.0] Keep the subscription date lists reaching the dates in use - #9401

Open
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/paidsub-year-range
Open

[3.0] Keep the subscription date lists reaching the dates in use#9401
albertlast wants to merge 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/paidsub-year-range

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

Admin → Paid Subscriptions → modify a subscriber builds its start and end year drop-downs from a hard coded range:

for ($year = 2005; $year <= 2030; $year++) {

Two consequences:

  • No subscription can be given an end date past 2030. With a one-year subscription that is four renewals away.
  • An existing subscription whose dates fall outside the range loses its own year from the list. No <option> carries selected, so the browser shows the first one, and saving the form moves the date to 2005 without saying anything.

They now run ten years either side of today, widened where necessary to take in whatever the subscription already carries, so the stored value is always one of the options. Straight off the running forum, on 2026-08-08:

before   2005 … 2030
after    2016 … 2036

The inline monthLength array at the top of the function goes as well. generateDays() lives in script.js now and declares its own, so this copy — carrying the comment "Some quickly stolen javascript from Post, could do with being more efficient" — has not been read by anything since that function was moved out of the templates.

Post.template.php still declares the same dead array; I left it alone rather than widen this diff into the posting screen.

This comes out of the #7933 branch, which makes the same range calculation; per the grouping asked for there, the paid subscription templates are their own area.

Issues References (Fixes|Related|Closes)

Related to #7933

The start and end year drop-downs on Admin -> Paid Subscriptions -> modify a
subscriber were a hard coded 2005 to 2030. So no subscription can be given an
end date past 2030, and an existing subscription that runs beyond it loses its
own year from the list: the select falls back to its first option, and saving
the form silently moves the date to 2005.

They now run ten years either side of today, widened where needed to take in
the dates the subscription already carries, so whatever is stored is always
one of the options.

Also drops the inline monthLength array. generateDays() in script.js declares
its own, so the copy here has done nothing since that function was moved out
of the templates.

Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast albertlast mentioned this pull request Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant