Advertisement:

Author Topic: I apologize for the absurd question, but...  (Read 17800 times)

Offline NinaSay

  • Newbie
  • *
  • Posts: 3
I apologize for the absurd question, but...
« on: August 05, 2012, 09:52:36 PM »
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!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #1 on: August 05, 2012, 09:58:27 PM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline NinaSay

  • Newbie
  • *
  • Posts: 3
Re: I apologize for the absurd question, but...
« Reply #2 on: August 05, 2012, 10:00:10 PM »
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #3 on: August 05, 2012, 10:03:01 PM »
Running the large upgrade would likely remove your mods. Your theme will require some changes, there's no way around that.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #4 on: August 05, 2012, 11:05:34 PM »
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. :)
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #5 on: August 05, 2012, 11:13:22 PM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #6 on: August 06, 2012, 06:41:08 AM »
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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #7 on: August 06, 2012, 07:21:25 AM »
upgrade.php nukes the installed list but AFAIK it does not clear hooks.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #8 on: August 06, 2012, 07:48:51 AM »
ah...

Code: [Select]
  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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #9 on: August 06, 2012, 07:52:49 AM »
Also send a call to cache_put_data('modsettings', null) while you're at it (or use updateSettings to do it properly)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #10 on: August 06, 2012, 08:07:11 AM »
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?
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #11 on: August 06, 2012, 08:12:25 AM »
>_>

That instruction clears the cache, not the actual items.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #12 on: August 06, 2012, 09:33:27 AM »
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)
Code: [Select]
  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_'));


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #13 on: August 06, 2012, 09:35:13 AM »
And that still doesn't clear the cache ;)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #14 on: August 06, 2012, 09:41:58 AM »
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.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #15 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

Code: [Select]
<?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'null0);
?>


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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #16 on: August 06, 2012, 09:53:22 AM »
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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #17 on: August 06, 2012, 10:06:39 AM »
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #18 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 ;)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #19 on: August 06, 2012, 10:33:44 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...

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #20 on: August 06, 2012, 10:35:21 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:)


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,579
  • Gender: Male
    • Kindred-999 on GitHub
Re: I apologize for the absurd question, but...
« Reply #21 on: August 06, 2012, 10:40:23 AM »
Sorck,

No...   what Arantor is discussing if the code done for Wedge.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #22 on: August 06, 2012, 10:44:05 AM »
Quote
Yes, 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.

Quote
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?

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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline NinaSay

  • Newbie
  • *
  • Posts: 3
Re: I apologize for the absurd question, but...
« Reply #23 on: September 12, 2012, 05:13:04 PM »
I know it has been a while since I replied, but thank you for the information. I will be attempting the upgrade this week.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #24 on: September 21, 2012, 06:18:13 AM »
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

Code: [Select]
<?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'null0);
?>

Hope you don't mind if I have stolen your query for repair settings... O:)
https://github.com/emanuele45/tools/commit/db9a843b0a3ccafc889668ccb27a6d8d8cf95377


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #25 on: September 28, 2012, 06:31:58 PM »
You know what, I have a feeling Arantor knows that the cache needs emptying for that to work properly. :P

Code: [Select]
<?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'null0);
?>

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...

TheListener

  • Guest
Re: I apologize for the absurd question, but...
« Reply #26 on: September 28, 2012, 06:35:55 PM »
Emanuele test something before he uses it?

How do ya think he breaks so many things?

 :D

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #27 on: September 28, 2012, 07:01:00 PM »
Emanuele test something before he uses it?
^^ This!

* emanuele 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


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #28 on: September 29, 2012, 11:40:09 AM »
*cough* Look at the commit...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: I apologize for the absurd question, but...
« Reply #29 on: September 30, 2012, 05:07:06 AM »


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Sorck

  • Jr. Member
  • **
  • Posts: 268
  • Gender: Male
  • Is it a bird? Is it a plane? Of course it's not.
    • Sorck on GitHub
    • Second Sphere
Re: I apologize for the absurd question, but...
« Reply #30 on: September 30, 2012, 05:55:25 AM »
Out of interest, will SMF not escape the '%' character if it's being put in as type string?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,870
    • StoryBB/StoryBB on GitHub
Re: I apologize for the absurd question, but...
« Reply #31 on: September 30, 2012, 01:19:58 PM »
No, it won't. And if you put it outside as you had it, you'd end up with LIKE 'integrate_'% which is invalid.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.