News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problem when upgrading 2.0.6 to 2.0.7 with one file

Started by rickmastfan67, January 27, 2014, 01:39:06 PM

Previous topic - Next topic

rickmastfan67

Ok, I've been trying to figure out why the forum I help admin will not properly upgrade from 2.0.6 to 2.0.7.  In the past, this has never been a problem, even with the mods we have installed.

Everything in the upgrade for 2.0.7 checks out with no problems except for one section in the "./Sources/Subs-Post.php" file.  So, I ask my buddy who has the FTP access to the server to send me the file so I can see if I can figure out what is going wrong.  When he does, I checked over the file and I manually searched (using Notepad ++) to find the area that is having the problem.  When I did the search, the line of code was found to be exactly the same as what the updater was suppose to find, but was still throwing up the "Test Failed" message.

This is the one and only area that the update is choking on:

Code: (Find)

// Attempt to un-parse the time to something less awful.
$parts[$i] = preg_replace('~\[time\](\d{0,10})\[/time\]~ie', '\'[time]\' . timeformat(\'$1\', false) . \'[/time]\'', $parts[$i]);

Code: (Replace)

// Attempt to un-parse the time to something less awful.
$parts[$i] = preg_replace_callback('~\[time\](\d{0,10})\[/time\]~i', create_function('$m', ' return "[time]" . timeformat("$m[1]", false) . "[/time]";'), $parts[$i]);


This is the only place the update is having any problems.

Does anybody know what might be the problem here?  As this is really stumping me.

And for reference, here are the mods we have installed (removed custom made mods that only tweak the themes):


Modification Packages
Mod Name Version
3. Add Social Media Icons To Profiles 1.0.5 [ Uninstall ] [ List Files ] [ Delete ]
4. Age And Location 1.0 [ Uninstall ] [ List Files ] [ Delete ]
5. Auto Merge Double Post 1.5.1 [ Uninstall ] [ List Files ] [ Delete ]
7. Join Reason 1.3 [ Uninstall ] [ List Files ] [ Delete ]
8. Last Login Info Beside Posts 0.0.1 [ Uninstall ] [ List Files ] [ Delete ]
9. New In Topic View 1.1.1 [ Uninstall ] [ List Files ] [ Delete ]
10. Ohara YouTube Embed 1.0 [ Uninstall ] [ List Files ] [ Delete ]
12. Users Online Today 2.0.2 [ Uninstall ] [ List Files ] [ Delete ]
13. More Spiders 1.2 [ Uninstall ] [ List Files ] [ Delete ]
14. Global Headers Footers 2.0.1 [ Uninstall ] [ List Files ] [ Delete ]
15. SMF Staff Page 1.7 [ Uninstall ] [ List Files ] [ Delete ]
16. SMF 2.0.3 Update 1.0 [ List Files ] [ Delete ]
18. SMF 2.0.4 Update 1.0 [ List Files ] [ Delete ]
19. SMF 2.0.5 Update 1.0 [ List Files ] [ Delete ]
20. SMF 1.1.19 / 2.0.6 Update 1.0 [ Uninstall ] [ List Files ] [ Delete ]
21. Tapatalk SMF 2.0 RC5/Final Plugin 3.9.1 [ Uninstall ] [ List Files ] [ Delete ]


Any help would be appreciated.  Thanks again.

margarett

Just tested again and it works here. Can you paste the code you have or upload your file?
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

rickmastfan67

#2
Here's the "./Sources/Subs-Post.php" file.

EDIT: Deleted incorrect file.

margarett

There is something really wrong with that file. It's MUCH smaller that the original one. I got a lot of "Test failed" in it, specifically 1, 2, 7, 9, 11, 13. But the one you mention (12) doesn't show up as failed...
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

Shambles

I think the first package error would show up by not being able to locate the version update string.

<search position="replace"><![CDATA[
* @copyright 2011 Simple Machines
* @license http://www.simplemachines.org/about/smf/license.php BSD
*
* @version 2.0




.. whereas you have

/**********************************************************************************
* Subs-Post.php                                                                   *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1.9                                           *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006-2009 by:     Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/



That doesn't look like the correct Subs-Post.php file that you posted to us.

rickmastfan67

I see that now.   Hmmmmm.  Guess he sent me the wrong file somehow.....

I'll have to check with him again.

rickmastfan67


margarett

In your file the line after "// Attempt to un-parse the time to something less awful." is commented out. That's why it isn't found :P
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

rickmastfan67

Quote from: margarett on January 27, 2014, 02:35:51 PM
In your file the line after "// Attempt to un-parse the time to something less awful." is commented out. That's why it isn't found :P

I don't know why that would be commented out.  Do you have any idea what mod I listed above might have done that?

rickmastfan67

Ok, I have figured out what mod did this.  It was the "Auto Merge Double Post" one found in this post.  Oh boy.  And this is a mod we need on our forum.

<file name="$sourcedir/Subs-Post.php">
<operation>
<search position="replace"><![CDATA[$parts[$i] = preg_replace('~\[time\](\d{0,10})\[/time\]~ie', '\'[time]\' . timeformat(\'$1\', false) . \'[/time]\'', $parts[$i]);]]></search>
<add><![CDATA[// $parts[$i] = preg_replace('~\[time\](\d{0,10})\[/time\]~ie', '\'[time]\' . timeformat(\'$1\', false) . \'[/time]\'', $parts[$i]);]]></add>
</operation>

margarett

Here's the catch: whatever you do, you will be unable to revert :-)
You can uncomment, install the patch and comment again. That will allow the upgrade to install and your mod to keep running but you will be unable to uninstall it.
Or you can ignore that error and proceed. But, if you uninstall the mod, you will get php warnings if you run a version above 5.5. Now what? :-)
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

rickmastfan67

I think I might manually mod the "Auto Merge Double Post" file so that I can uninstall it in the future if need be. :)  I'll have to set some time aside later today to do it.

WCFA

Since this is based on the same type question:

I am using FTP to modify the permissions, what files needs the cmod settings and what are they ?
For some reason using SMF with my user/pass etc wont work and it needs modifying but which files and
what settings ?

Thanks

Lou69

Setting the permissions for 775 or 755 should do. When the FTP offers to do a sub-directory recursive tell it yes.

If you are having problems on an install or upgrade just make it all 775 until you are finished.

If your are not able to make those changes via SMF then your host may not have given you ownership of the files and you will need to ask them to make the permission changes for you. But first, try the changes with FTP and see if they work.

Advertisement: