Closed chrisblakley closed 1 year ago
@terencehoverter Unfortunately this is not resolved. We'll have to look into it further. Options are still reverting to default values on multisite installs.
@chrisblakley I'll test some tweaks when updating EXC and UNIV. Assuming you tested on OCR?
Another proposed solution for the options interface itself:
<input name="nebula_options[force_wp_timezone]" value="<?php echo $nebula_options['force_wp_timezone']; ?>"><input id="force_wp_timezone" value="1" type="checkbox" onclick="this.previousSibling.value=1-this.previousSibling.value" <?php checked('1', !empty($nebula_options['force_wp_timezone'])); ?>><label for="force_wp_timezone">Force WP Timezone</label>
Another idea is to try a hidden input field without js and see if the server prioritizes the "later" value:
<!-- Hidden input for the checkbox -->
<input type="hidden" name="checkbox_name" value="0">
<!-- The actual checkbox -->
<input type="checkbox" name="checkbox_name" value="1" checked>
In this example, if the checkbox is unchecked, the "checkbox_name" parameter with a value of "0" will be sent to the server. If it is checked, the "checkbox_name" parameter with a value of "1" will be sent as well- theoretically overriding the 0 value (but that part seems a little risky).
Confirming this is now fixed. The options no longer revert.
When doing a Nebula update on a multi-site install, some Nebula options are reverting to their default values on the first instance of the multi-site (and not subsequent instances). It appears to only be affecting the first sub-site, and only on boolean options (not text-based string input options).
This appears to be due to that theme updates do not happen at the sub-site level– instead they happen on the Network admin which is not associated with a single sub-site's DB table. This means that when Nebula checks for "new" options, it is not seeing it and when it attempts to "create" and set the "new" option, the first (un-prefixed) DB table is updated to the default value.
For example, DB tables in WordPress multisites are prefixed as:
wp_options
wp_2_options
wp_3_options
Solutions to this issue would be to:
We can detect if a site is a multisite with
is_multisite()
and we can count the number of sub-site installs withget_sites(array('count' => true))
. This would be how we form the loop.The function we need to update here is Nebula's
check_for_new_options
inside of the Admin.php function.