Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
JQThickBox
This discussion has been closed.
Comments
After using it for about an hour the site was not reachable, after figuring out what happend i noticed the settings.php only contained the following:
$Configuration['JQTHICKBOX_VERSION_EXT'] = '1.1.3'; $Configuration['JQTHICKBOX_VERSION_JS'] = '2.1.1'; ?>
All the rest was gone. Don't know why this happend, i didn't even changed any settings.
I was not even logged in, so it happens if a user is using the extention.
I disabled the extention, but i still think it is very cool and want to enable it again.
I will walk through the code and let you know if i find something that worries me that can be the reson for this. Get back to you on this one.
if (!AppendToConfigurationFile($Configuration['APPLICATION_PATH'].'conf/database.php', $Structure)) $Errors = 1; if ($Errors == 0) { AddConfigurationSetting($Context, 'THANKFULPEOPLE_VERSION', '1.0'); } else { // Could not save configuration $NoticeCollector->AddNotice($Context->GetDefinition('ErrCreateConfig')); }
When we develop add-ons and add settings, should we be doing something like this? Does this mean there is a setting to either append to the config file or create a new one?
jimw - that looks like it should make sense. Can we get an answer on this from Mark please?
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_EXT', '1.1.3');
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_JS', '2.1.1');
Those 2 lines are called every single time the default is loading.
The same is happening in the jquery addon.
So for every page load the settings.php is changed 2 times. On a heavily used system the settings.php will be rewritten several times in a short time span.
When several processes try to rewrite the same file at the same time this can be a problem with the vanilla code.
read the thread http://lussumo.com/community/discussion/6428/ about the problem with the race-conditions in the vanilla function:SaveSettingsToFile
This is a bug in Vanilla, So i ask you are those lines for the settings realy nessecary? or can i just remove them.
if (!array_key_exists('JQTHICKBOX_VERSION_EXT', $Configuration))
{
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_EXT', '1.1.3');
}
else if ($Configuration['JQTHICKBOX_VERSION_EXT'] != '1.1.3'){
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_EXT', '1.1.3');
}
if (!array_key_exists('JQTHICKBOX_VERSION_JS', $Configuration))
{
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_JS', '2.1.1');
}
else if ($Configuration['JQTHICKBOX_VERSION_JS'] != '2.1.1'){
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_JS', '2.1.1');
}
- people are reporting issues with TB3 on Cody's TB forums that they didn't have with TB2
- My one's already highly optimised, so you won't actually gain all that much by going to TB3
- I've already got most of the fixes in TB3 (there are a couple that aren't in there yet, but most are)
- My wife gave birth to our first child nearly 4 weeks ago and I've not had time to think abut anything else just yet.
I'm planning on updating the plugin with an admin section where you can pick and choose which version of TB you use via a simple drop down. If you desperately want TB3 now, then just drop in the .js file and overwrite the current one - it should work just fine.Those settings aren't essential just yet, so you can probably remove them without any problems. Has anyone given those if statements a go? Do they stop the problem from happening? If someone can confirm this to me I'll get the extension updated, only I don't have time to test at the moment.
Thanks for everyone's help
Not like you need it, but you have my permission to selfishly attend to your family. Congratulations!
{
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_EXT', '1.1.3');
}
if (!array_key_exists('JQTHICKBOX_VERSION_JS', $Configuration))
{
AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_JS', '2.1.1');
}
This code will stop it from adding it every single page call, the version check above does not work.
btw this is not the only extention with this problem, extention with this problem found:
JQthickbox
Jquery
Discussion view counters
zip2mail
The best solution for this problem is to fix the vanilla framework code to check in the "AddConfigurationSetting" functions a check if it already exists and if so if the value is different. But hey, the site clearly tells us we can not modify any code in there
But if you don't care about that replace the function "AddConfigurationSetting" in the \library\framework\framework.functions.php I have tested it briefly on my test server and didn't encounter any problems. Maybe if there is some one out there that has a test server also it can be tested some more.
function AddConfigurationSetting(&$Context, $SettingName, $SettingValue = '1') { if ((!array_key_exists($SettingName, $Context->Configuration))|($Context->Configuration[$SettingName]!=$SettingValue)){ $Context->Configuration[$SettingName] = ''; $SettingsManager = $Context->ObjectFactory->NewContextObject($Context, 'ConfigurationManager'); $SettingsFile = $Context->Configuration['APPLICATION_PATH'].'conf/settings.php'; $SettingsManager->DefineSetting($SettingName, $SettingValue, 1); $SettingsManager->SaveSettingsToFile($SettingsFile); } }
Is there some one that knows how to contact the vanilla theme. I think this should go in to the new version, or a variant of this, this drastically reduces file writes on the server.
I think the following will work, but does anyone who knows what they're doing with PHP see any problems with it?
$JQTBext = '1.1.4'; $JQTBjs = '2.1.1'; // Set the Extension and JavaScript version numbers. if (!array_key_exists('JQTHICKBOX_VERSION_EXT', $Configuration) || ($Configuration['JQTHICKBOX_VERSION_EXT'] != $JQTBext)) { AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_EXT', $JQTBext); } if (!array_key_exists('JQTHICKBOX_VERSION_JS', $Configuration) || ($Configuration['JQTHICKBOX_VERSION_JS'] != $JQTBjs)) { AddConfigurationSetting($Context, 'JQTHICKBOX_VERSION_JS', $JQTBjs); }