This repository has been archived by the owner on Feb 23, 2019. It is now read-only.
Save Cloudflare Settings - SSL Update Failure #334
Merged
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.
After clicking the Save Cloudflare Settings button within the CloudFlare settings' extensions page a Failed to update option ssl: Invalid value for zone setting, ssl alert message is seen (see the attached image). This error seems to occur consistently when the SSL drop-down box is modified to Off.
Why The Problem Occurs
This error occurs because the words: on and off are special indicators to W3TC when dealing with checkbox values. Because the SSL drop-down list box is not a checkbox and in fact uses the keyword off, W3TC was mistakenly confusing it as a checkbox and, thus, setting the final SSL value as the word: on.
But why on? Well, it does this because since it mistakenly assumed it was dealing with a checkbox it figured the value had to be an integer. But since the value: off, which the SSL drop-down sent to W3TC, is not an integer it defaulted to setting the final value, which is sent to Cloudflare, as the word: on. Now, because Cloudflare doesn't understand the word on, under the context for setting the SSL, it returned back a failure response.