[3.0] Keep the subscription date lists reaching the dates in use - #9401
Open
albertlast wants to merge 1 commit into
Open
[3.0] Keep the subscription date lists reaching the dates in use#9401albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
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>
Closed
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
Admin → Paid Subscriptions → modify a subscriber builds its start and end year drop-downs from a hard coded range:
Two consequences:
<option>carriesselected, 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:
The inline
monthLengtharray at the top of the function goes as well.generateDays()lives inscript.jsnow 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.phpstill 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