Remove legacy user information options from system report data - #3277
Open
dotance wants to merge 1 commit into
Open
Remove legacy user information options from system report data#3277dotance wants to merge 1 commit into
dotance wants to merge 1 commit into
Conversation
The lifterlms_user_info_field_*_visibility and lifterlms_voucher_field_registration_visibility options were superseded by LifterLMS Forms in 5.0.0. LLMS_Data::get_llms_settings() still read fourteen of them into the system report and tracker payload, where they no longer describe how any form is rendered. The remaining reads of these options are left alone, since they are still doing work: - LLMS_Form_Templates reads them to build form templates during migration from pre-5.0.0 installs. - LLMS_Admin_Tool_Wipe_Legacy_Account_Options exists to delete them. - llms-functions-updates-300.php is a historical 3.0.0 migration. $data['open_registration'] sat inside the same block but reads lifterlms_enable_myaccount_registration, which is a live setting, so it is kept. Fixes gocodebox#1675
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
LLMS_Data::get_llms_settings()read fourteen legacy options into the system report and tracker payload:lifterlms_user_info_field_{names,address,phone,email_confirmation}_{checkout,registration,account}_visibilitylifterlms_voucher_field_registration_visibilityThese were superseded by LifterLMS Forms in 5.0.0. On any install since then they no longer describe how a form is actually rendered, so the values reported are at best stale and at worst misleading when someone is reading a system report to debug a form.
This removes those reads.
$data['open_registration']sat inside the same block but readslifterlms_enable_myaccount_registration, which is still a live setting, so it is kept and moved above the removed lines.What is deliberately left alone
The other readers of these options are still doing real work:
includes/forms/class-llms-form-templates.phpincludes/admin/tools/class-llms-admin-tool-wipe-legacy-account-options.phpincludes/functions/updates/llms-functions-updates-300.phpThe
class.llms.notification.view.student.welcome.phpline referenced in the issue already went throughLLMS_Forms::instance()->are_usernames_enabled(), which readsllms_forms_username_locations— so that one appears to have been resolved since the issue was filed.One thing worth a maintainer's eye
get_llms_settings()feeds both the admin System Report andLLMS_Tracker. So this changes the shape of the tracker payload — fourteen keys disappear. That seems like the intent of the issue, but if anything downstream consumes those keys I'd rather you tell me now than find out after a release. Happy to restrict the change to the system report and leave the tracker untouched if you prefer.Fixes #1675
How has this been tested?
lifterlms_user_info_field_*andlifterlms_voucher_field_*to confirm the three remaining call sites above are the only ones, and that each is still load-bearing.$datakeys (checkout_names,registration_address, and so on).LLMS_Admin_System_Report::output()iterates the array generically rather than referencing keys by name, so the only visible effect is that those rows stop being rendered.composer run-script check-cs-errorsagainst this file on bothupstream/devand this branch. Both report the same 16 pre-existing errors (PSR2.Methods.FunctionClosingBrace.SpacingBeforeClose×15,PSR2.Classes.ClassDeclaration.CloseBraceAfterBody×1) and nothing else — this change adds no new PHPCS violations.I did not run PHPUnit locally (it needs a MySQL instance and the WP test suite); the workflow runs on this PR.
Types of changes
Removal of superseded reporting data — no change to how forms behave.
Checklist: