News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

my self-inflicted hell (a cautionary tale - also, HELP!)

Started by permutations, May 19, 2015, 09:36:21 PM

Previous topic - Next topic

permutations

I'm pretty sure that the thing to look at is upgrade.php - or rather, upgrade_1-1.sql - which pretty clearly has a bug. That's what I'm doing now. I easily found the general area where it failed. Maybe I can find the problem.


permutations

I requested extended error logging when I ran the upgrade script. Where do I find the error log?

permutations

I read the code. The errors are written to the database, table log_errors. That table in my database is empty (I emptied it before the run), so no error is being logged by upgrade.php.

I discovered that upgrade.php has a debug mode. I set that, but when I try to run from where I left off, it does nothing (as I suspected - it's not some long running process). So I need to once again reset everything (delete the files and database, recreate the cloned site, etc.). Then I'll run upgrade.php in debug mode, and this will tell me exactly where it is hanging.

permutations

I upgraded from SMF 1.1 Beta 3 to SMF 1.1.21 (latest 1.1 version). The script succeeded, and now - wonder of wonders - my board groups are no longer in the wrong order. That seems promising.

I'm now going to attempt to upgrade from SMF 1.1.21 to SMF 2.0.10. Maybe it will go better when it's the latest version of SMF 1.1. I ran the previous upgrade script in debugging mode, and I'm going to do the same with the next one. I'm going to back up the database and files first, so I can start again from this intermediate point if the SMF 2.0.10 upgrade fails again.

-------------

Edit: I can only have one backup of a particular type in the Control Panel. I don't want to wipe out the backup of my live site, so I guess I'll do without the intermediate backup. I could download it, but it's huge. Not worth it.


permutations

Whoa! I just looked at the updated database, and there is one major difference. SMF 1.1 Beta 3 had one table called log_search and no log_search_*. SMF 1.1.21 has the same for log_search_* tables that SMF 2.0.10 has. It is during the update of the search cache (the log_search_* tables) that the upgrade to 2.0.10 has been failing. I don't think that's a coincidence. I'm starting to suspect that my first theory was correct - that it didn't have code to handle my specific version, SMF 1.1 Beta 3. I am hopeful that the upgrade to 2.0 will work now. About to try...

permutations

Success!! Phew. My site looked very peculiar right after the upgrade because of some ghost themes. But when I deleted those, the default theme loaded and all was well.

This was the easy part (theoretically, though it took me 2 days of effort). Now I have to re-implement my payment system, hopefully as a mod. But first I have to remember how to write a mod.

margarett

Thank you for letting us know. And I'm sorry that we were unable to detect that for you. I had already decided that I would be installing 1.1B3 today to try the upgrade myself, good thing it's not needed anymore :)

Now that the upgrade is performed, we can go back to the "integration" part of the problem.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

margarett

QuoteI made a huge number of changes to the SMF code - adding numerous features and tweaking how things worked. But I don't absolutely need all of that
If I understand it correctly, none of these things have anything to do with the payments control.

For the payments system, I'm pretty confident that this is enough:
Quote from: margarett on May 21, 2015, 08:50:35 PM
QuoteSMF doesn't need to know any of this - it just needs to know if the person has access or doesn't - the payment status. Thus I use only four SMF member groups (the additionalGroups field): Current, End Near, Expired, Never Paid. I have a near-end member group so I can send automated renewal instructions. I distinguished between Expired and Never Paid so my sales tracking script can analyze whether free trials lead to conversions (payments).

This. This is what I was trying to understand. And, as I suspected, you don't need to change almost *ANYTHING* for this to work. The upgrader will keep your membergroups and its permissions so, as long as your script continues to update additional groups, everything works.
You just need to tweak your script to read/modify the column "additional_groups" instead of "additionalGroups" ;)
:)

Can you list the features that you added or that you need? SMF 2.0 introduced some new features, compared to 1.1 and there is a great number of MODs available, maybe some of those might exist already? ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

permutations

The only feature from my extensive changes that I'm going to implement again is my payment system, but that alone is a huge. My payment system is deeply integrated into the SMF interface. For example, I modified the profile so that the site administrator and the profile owner can see information about payment status, and when access will expire. I changed many templates, including the registration template. It's a bear.

The first step is to do file by file comparisons to see what I did. It was 10 years ago, so it's fuzzy. When I started, I very carefully documented every change because I planned to make it a mod. But when the changes became very extensive, I just gave up on that and made changes wherever without noting what it was. The one thing I was always careful to do, thankfully, was note which files I changed, so I know exactly what files I need to compare to the originals. On the downside, there are 47 of them. :(

margarett

One problem at a time ;)

QuoteI modified the profile so that the site administrator and the profile owner can see information about payment status, and when access will expire
This is much doable, and not so difficult. Take a look at this MOD I made:
http://custom.simplemachines.org/mods/index.php?mod=3890
Not related to what you want, but look how easy it is to add a new profile section ;)

QuoteThe first step is to do file by file comparisons to see what I did.
Again, one problem at a time. Of course you know your problem better than I do, don't get me wrong, I'm only trying to help. But I really think that you should make a list of everything you need to do (and share it with us if you want to), then tackle one problem at a time.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Kindred

also note that 2.0.x has a significant number of HOOKS that can be used to link external things into the SMF system.
http://wiki.simplemachines.org/smf/Category:Integrating_SMF

this might make things easier for you....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

permutations

Thanks so much for your help and support, Kindred and margarett - much appreciated!

Quote from: Kindred on May 22, 2015, 12:56:13 PM
also note that 2.0.x has a significant number of HOOKS that can be used to link external things into the SMF system.
http://wiki.simplemachines.org/smf/Category:Integrating_SMF

this might make things easier for you....

I looked very carefully at the hooks that were available back when I first did this. I wasn't able to use them at the time - couldn't do what I needed - but I'm sure there are many more now. I'll take a look.

My own code is very complete and mature, so I suspect it will be easier to just reapply it. But I will soon see!

Quote from: margarett on May 22, 2015, 12:52:06 PM
But I really think that you should make a list of everything you need to do (and share it with us if you want to), then tackle one problem at a time.

That's the plan! Need some coffee, then I'll start.  :)

permutations

Still working on this. It's slow going. I want to implement my payment system as efficiently as possible - the absolute minimum number of code lines. First I have to understand what I was doing, then think about the best way to do it in the rewrite. Then I log it in a mod file. I hope this doesn't take me until the end of time.

I notice that FlashChat is part of SMF 2.0. I had added that to my modified version of SMF 1.1. Quite a few features that I had manually added are now part of SMF 2.0.

permutations

Apparently I created a mod for the Post Moderation part of my code and uploaded it to SMF. I have a package, complete with documentation.

Kindred

Flash chat is not part of 2.0

Post moderation already exists in 2.0 as a feature...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

permutations

Too bad there's no integration hook right after session_start() in the loadSession() function (Load.php). There are two hooks in Load.php, but there are both before the session is started. I need to initialize some session variables. Seems like something others might need to do, too.


permutations

I added FlashChat to my customized SMF 1.1 Beta 3 and it seems to be part of SMF 2.0, but I can't see how to active and use it. How do I turn this on?

Illori

Quote from: permutations on May 23, 2015, 04:27:05 AM
I added FlashChat to my customized SMF 1.1 Beta 3 and it seems to be part of SMF 2.0, but I can't see how to active and use it. How do I turn this on?


as kindred said it is not part of 2.0. you have install the mod for it.

permutations

I just realized that the FlashChat I'm seeing is from what I installed myself before I upgraded. Duh.  :-[

permutations

In my SMF 1.1 Beta 3 installation, I used "wrapping and catching" actions in index.template.php. I see this still exists in SMF 2.0 from this link:

http://support.simplemachines.org/function_db/index.php?action=view_function;id=443

But I can't find documentation anywhere except what I have as a comment in my code, and I don't know where I got that or if it still works that way. Where can I find information on this?

Advertisement: