• Welcome to Simple Machines Community Forum. Please login or sign up.
November 27, 2021, 01:47:32 AM

News:

SMF 2.0.18 has been released! Please update. Read more.


Post History

Started by niko, May 23, 2009, 01:02:36 AM

Previous topic - Next topic

Kindred

the strange  thing is...  I have this installed on 2.0.15 with no errors at all.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arnox

Quote from: Kindred on May 12, 2018, 04:56:51 PM
the strange  thing is...  I have this installed on 2.0.15 with no errors at all.

I think it only starts happening if you upgrade to 2.0.14 with it installed. And since it doesn't uninstall completely, the problem remains. Or at least that's what I think is happening.

Could you test something for me though? Just make an edit to any post and then try to view the edits. The popout seems to have the right URL but instead of showing me the edit history, it just dumps me right back to the forum main page. What's even more frustrating is that it's not printing out an error in the error log at all.

Kindred

I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arnox

Quote from: Kindred on May 12, 2018, 10:06:36 PM
I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function

Hm... Do you have any idea at all why it's redirecting the popout back to the home page instead of bringing up a post's edit history?

Arnox

Quote from: Kindred on May 12, 2018, 10:06:36 PM
I did...   I had it installed, upgraded to 2.0.14 and 2.0.15 with no issues.

And it works just as it is supposed to, as of last week, which is the last time I used the history function

Also, are you actually running PHP 7.0 or above? Or PHP 5.6 and below?

I recall post history working beautifully when I had 5.6.

Arnox

May 13, 2018, 02:48:41 AM #185 Last Edit: May 13, 2018, 03:20:07 AM by Arnox
EDIT: FIXED IT. ****ING GOT 'EM.

To solve why the popout was dropping me back into the main page, I had to verse myself on how SMF very basically works internally.

So after poring over the install files and finding jack (or at least nothing that stood out to me), I decided to take a look at the main edit history URL.

"(my main forum domain)/index.php?action=posthistory;topic=5464.0;msg=69296"

I then started tracing exactly where each step was going. So as we can obviously see, it's starting out by making a usual request for the index.php of the forum. The starting point for most everything. The next part was the action it was calling. SMF has a long list of "actions" in its index.php that point to a file in the Sources directory and then a code function within that file. Usually the main starting code function.

Then I experimented and looked at what happened when I purposefully put in a bad (nonexisting) action call in the URL. So

"(my main forum domain)/index.php?action=ali;topic=5464.0;msg=69296"

The action "ali" is nonsense and doesn't exist in the index.php either. And there, I saw that it dumped me right back to the home page again. I had successfully duplicated the error. So now we know what exactly the error is.

I then took a look into my index.php and looked for a "posthistory" action. It didn't exist whatsoever. Hmmmmm... Now what's really strange is that it seemingly never HAD to exist in the index.php before for Post History to work. And I know this for an absolute fact too because all my old forum backups with Post History never had a "posthistory" action in any of their index.php's either. I looked. Nevertheless, nothing else seemed to make sense, so this simply had to be it.

I made a new action then in my index.php right beneath the 'post2' action.

'posthistory' => array('PostHistory.php', 'PostHistory'),

We're saying here that there is now indeed a posthistory action, and if it's called, bring up the main "PostHistory.php" file that is in the Sources directory and execute the "PostHistory" code function there.

After that, everything worked just fine. 1.0.5 zip below has the index.php install actions added now to avoid any future problems.

Kolya

I'm running the original code by Niko. It never produced errors in the log and survived upgrading the forum just fine.

That's not too say that it didn't have problems. Comparisons of complex posts tend to fail. And the order of edits isn't chronological.

But the problems you fixed sound self produced. Glad it works for you now, but when you find that the mod should have never worked according to your logic and yet you know it did, then it's time to rethink your approach.

Arnox

Quote from: Kolya on May 13, 2018, 11:55:30 AM
I'm running the original code by Niko. It never produced errors in the log and survived upgrading the forum just fine.

That's not too say that it didn't have problems. Comparisons of complex posts tend to fail. And the order of edits isn't chronological.

But the problems you fixed sound self produced. Glad it works for you now, but when you find that the mod should have never worked according to your logic and yet you know it did, then it's time to rethink your approach.

Are you running PHP 7.0 or above or are you using an earlier version?

Kolya

I'm running PHP 5.5.12

Arnox

Quote from: Kolya on May 13, 2018, 01:20:23 PM
I'm running PHP 5.5.12

That's why.

PHP 7.x brought a WHOLE lot of changes to how things are written. It's also a little more strict in what it accepts and what it doesn't. Things you could do that might have flown in 5.x might not work anymore in 7.0. For example, the leading '&' in actionArray and no posthistory action listed in index.php still work in 5.x but with 7.x, forget it. You need to fix it or drop the mod.

Kindred

I believe that we are on 7.1, but you never know for sure, with godaddy
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arnox

Quote from: Kindred on May 13, 2018, 08:28:25 PM
I believe that we are on 7.1, but you never know for sure, with godaddy

You can check your current PHP version by going here: (your domain)/index.php?action=admin;area=credits

Or at least what version your host is telling the forum it is.

Kindred

lol.... yes, I know....    but with godaddy, you never know what reality is.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Storebror

This is one of my all time favourite mods.
Is there any chance to update it to become compatible with SMF 2.1?

Cheers!
Mike

Kindred

since 2.1 is still only in RC, many mod authors may not choose to make updates until final.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.<br /><br />"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

Author hasn't been here in over 3 years.
No good deed goes unpunished
All helpful urges should be circumvented

Advertisement: