What is the difference between SMF 2.0 RC5 and SMF 2.0.2?
I am running SMF 2.0 RC5, and was wondering if there is any reason to upgrade and if there are any tutorials for it?
Thanks so much!
2.0 RC5 is a beta version, released prior to 2.0 (and since 2.0.2). There are some bugs in 2.0 RC5 that were fixed in later versions as well as multiple security vulnerabilities that have also been fixed.
Would running the large upgrade to 2.0.2 work? Would you know by any chance if mods/theme I'm using will still work?
Thank you for such a quick response.
Running the large upgrade would likely remove your mods. Your theme will require some changes, there's no way around that.
However, most mods and themes for RC5 will work just fine on 2.0.2
(you might want to check if the mods themselves have actually been upgraded in the mean time as well - if you are so far behind on keeping to forum up-to-date, you probably missed mod updates as well. :)
Yes, most mods will work. Except they need to be removed first before doing the upgrade because with hooks, it's possible things will be left behind that shouldn't be and so on.
It's a complicated, and slightly messy, situation.
hmmmmmm... I thought that the upgrade.php removed installed mods and hooks during the process.... I don't recall removing any mods during my site upgrade.
upgrade.php nukes the installed list but AFAIK it does not clear hooks.
ah...
echo 'Remove any hooks for the removed mods<br /><br />';
$integrate_columns = array('integrate_actions', 'integrate_admin_areas', 'integrate_bbc_buttons', 'integrate_bbc_codes', 'integrate_core_features', 'integrate_load_permissions', 'integrate_menu_buttons', 'integrate_pre_include', 'integrate_profile_areas');
foreach ($integrate_columns as $column)
$request = $smcFunc['db_query']('', 'DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}', array('variable' => $column));
add this as a php file in your forum directory and run it... that should take care of the hooks
Also send a call to cache_put_data('modsettings', null) while you're at it (or use updateSettings to do it properly)
hmmm.... I don't know that one. I threw this together as part of a "reset my forum" script.
but, in this case, do we really want to reset the modsettings? Wouldn't we want to preserve them for when the mod gets reinstalled?
>_>
That instruction clears the cache, not the actual items.
Also the list of hooks in that code is rather short and will not remove all the hooks present in 2.0.
That one is probably a bit drastic but it should remove all the hooks (along with any kind of setting that starts with "integrate_", but it should be unlikely that a mod introduced a setting whose name starts with "integrate_"...I hope)
echo 'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
And that still doesn't clear the cache ;)
lol... sorry Nina, We seem to have gone off on a tangent.
To re-state, unless you run the script provided by me or emanuele, you should probably uninstall your mods before upgrading.
Then download the large upgrade package, upload and unzip it and run upgrade.php
you can then re-install mods. The themes (other than the default) will likely be unaffected.
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P
<?php
require_once('SSI.php');
echo 'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
echo 'Now fixing the cache...<br /><br />';
cache_put_data('modsettings', null, 0);
?>
Quote from: Kindred on August 06, 2012, 09:41:58 AM
you can then re-install mods. The themes (other than the default) will likely be unaffected.
Just remember that version emulation might be needed. :)
You can find information about that via Package Manager (http://wiki.simplemachines.org/smf/Packages).
Either that or just uninstall mods before using the upgrade...
Also, SimpleDesk won't play nicely with that approach because it declares its own hooks that don't have the integrate_ prefix, which is why uninstalling mods is simply the cleanest way to do it.
smCore has a much nicer setup with a separate hooks table.
Clearing things out will be much nicer in the future. :P
But yes, clearing the mods is safer for most purposes. And unless you have a lot of mods it won't take very long.
The separate hooks table does add a performance penalty ;) Though I have an architecture around hooks that I particularly like, like automatically disabling all the hooks a plugin uses if I just rename or remove the folder a plugin is in ;)
Quote from: Arantor on August 06, 2012, 10:09:23 AM
The separate hooks table does add a performance penalty ;) Though I have an architecture around hooks that I particularly like, like automatically disabling all the hooks a plugin uses if I just rename or remove the folder a plugin is in ;)
Yes, there is an extra database query per page load/an extra cache hit.
This hooks thing seems interesting... I've never really looked through them in any detail in SMF 2.x or smCore. Am I right in assuming that the hook deletion things is related to smCore?
EDIT: on a side note this is getting more off-topic. :P There should be a place for discussing smCore beyond git and the smCore website as both of them are fairly quiet...
Quote from: Arantor on August 06, 2012, 09:35:13 AM
And that still doesn't clear the cache ;)
Yes of course, but you already posted about that so I didn't add the thing. :P
Yeah, I know, I should have... O:)
Sorck,
No... what Arantor is discussing if the code done for Wedge.
QuoteYes, there is an extra database query per page load/an extra cache hit.
Yes, and that's over and above what you're already doing for mod settings anyway.
QuoteThis hooks thing seems interesting... I've never really looked through them in any detail in SMF 2.x or smCore. Am I right in assuming that the hook deletion things is related to smCore?
Nope. As Kindred says it's what I did for Wedge, after a serious amount of benchmarking and testing, and thinking about it. I have no idea what smCore does, and to be honest I don't really care either.
There is another issue that hasn't been touched on directly in this debate - but it is the reason why the hooks must be cleared: if you do the upgrade files may be removed but the hooks that reference them may not have been.
My approach is to not actually engage the hooks until you know for certain the files etc are present - meaning that you have the overhead of doing that per page load, but the trade-off of being able to delete a plugin by merely deleting a folder and never having to worry about anything else is a serious bonus for me.
It's more to illustrate the deficiencies in the current process and one route that they can be solved by - something that I think SMF 2.1 should take into account a bit more than I understand it does currently.
I know it has been a while since I replied, but thank you for the information. I will be attempting the upgrade this week.
Quote from: Sorck on August 06, 2012, 09:48:12 AM
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P
<?php
require_once('SSI.php');
echo 'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
echo 'Now fixing the cache...<br /><br />';
cache_put_data('modsettings', null, 0);
?>
Hope you don't mind if I have stolen your query for repair settings... O:)
https://github.com/emanuele45/tools/commit/db9a843b0a3ccafc889668ccb27a6d8d8cf95377
Quote from: emanuele on September 21, 2012, 06:18:13 AM
Quote from: Sorck on August 06, 2012, 09:48:12 AM
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P
<?php
require_once('SSI.php');
echo 'Remove any hooks for the removed mods<br /><br />';
$smcFunc['db_query']('', 'DELETE FROM {db_prefix}settings WHERE variable LIKE {string:variable}%', array('variable' => 'integrate_'));
echo 'Now fixing the cache...<br /><br />';
cache_put_data('modsettings', null, 0);
?>
Hope you don't mind if I have stolen your query for repair settings... O:)
https://github.com/emanuele45/tools/commit/db9a843b0a3ccafc889668ccb27a6d8d8cf95377
Yep, you're fine to do so - it's nothing special. :P
Though I do hope you tested to see if it works before committing it...
Emanuele test something before he uses it?
How do ya think he breaks so many things?
:D
Quote from: Old Fossil on September 28, 2012, 06:35:55 PM
Emanuele test something before he uses it?
^^ This!
/me likes use others to do tests! >:D
BTW since it's only in my repo for now it's not a big issue. Sooner or later I'll test it... lol
*cough* Look at the commit...
Yep, thanks! ;D
Fixed it yesterday:
https://github.com/emanuele45/tools/commit/2c2a0e4d819b7d2f5e45a1f5afd4be80b1a273cb
Out of interest, will SMF not escape the '%' character if it's being put in as type string?
No, it won't. And if you put it outside as you had it, you'd end up with LIKE 'integrate_'% which is invalid.