Fix Virtual Host config file creation flow#487
Open
ebrasha wants to merge 1 commit into
Open
Conversation
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.
When adding a new Virtual Host through the WebAdmin panel, entering a path for a non-existent config file (for example
$SERVER_ROOT/conf/vhosts/Example2/vhconf.conf) shows the expected error:Clicking the
CLICK TO CREATEbutton does create the file on disk, but the Virtual Host itself is never saved. The user has to re-enter everything and click Save again — and many users reported the button feeling completely broken.Inside
dist/admin/html.open/lib/LSWebAdmin/Config/Validation/CValidation.php, after the file is created the validator returns0(STOP), which tells the save flow to halt:This was acceptable for things like a missing
userDBfile, but for the Virtual Host registration form it leaves the user with a freshly created emptyvhconf.confand no Virtual Host entry in the config — which looks exactly like the button did nothing.Fix:
For the Virtual Host config file (
filevh), return1(OK) after a successful creation so the save flow continues and the Virtual Host is registered in the same submit. Behavior for other file types (templates, user DBs, etc.) is unchanged.Also resolved POST lookup through the request's input source instead of touching
$_POSTdirectly, to match the rest of the validator:CLICK TO CREATEnow createsvhconf.conf(and its parent directory) and saves the Virtual Host in a single click.