• Welcome to Simple Machines Community Forum. Please login or sign up.

Failed tests when trying to update from 2.0.15 to 2.0.16

Started by jamesbond007, June 03, 2020, 12:06:53 PM

Previous topic - Next topic

jamesbond007

Hi, for the first time I'm trying to do an update, in this case from SMF 2.0.15 to 2.0.16 (and in the next step I would like to go to 2.0.17). I am following the "Patching" instructions on this page: https://wiki.simplemachines.org/smf/Patching

After clicking the link that takes me to the package manager, I get the following errors:

hxxp:iili.io/JOOEzX.png [nonactive]
hxxp:iili.io/JOOGXn.png [nonactive]

The following mods are installed on my installation:

  • nCode Image Resizer 2.0
  • SimplePortal 2.3.7
  • Responsive Curve 1.0.0
  • Ohara YouTube Embed 1.2.9
See also screenshot #3: hxxp:iili.io/JOejCg.png [nonactive]

The two files with the conflicts (QueryString.php and Subs.php) will be found as attachments to this post.

I would be glad if anyone could help me out and point out what to do to update my installation to 2.0.16 (and then to 2.0.17).

Thanks in advance & kind regards,
jamesbond007.

jamesbond007

Here are the details for the three failed tests:

The first one refers to the file ./Sources/QueryString.php:

Search:
$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"~', 'pathinfo_insert__preg_callback', $buffer);
}


Insert after:

// Be nice and try to inject session tokens into login forms since many older themes don't.
if ($user_info['is_guest'])
$buffer = preg_replace_callback(
'~(<form[^<]+action=login2(.+))</form>~iUs' . (!empty($context['utf8']) ? 'u' : ''),
function ($m) use ($context)
{
$repl = '';
if (strpos($m[0], $context['session_var']) === false)
$repl .= '<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"/>';

return $m[1] . $repl . '</form>';
},
$buffer
);


The second one refers to the file ./Sources/Subs.php:

Search:
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
'validate' => function (&$tag, &$data, $disabled)
{
global $image_proxy_enabled, $image_proxy_secret, $boardurl;

$data = strtr($data, array('<br>' => ''));
if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
$data = 'http://' . $data;

if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
$data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);
},


Replace:
'content' => '<img src="$1" alt="{alt}"{width}{height} class="bbc_img resized" />',
'validate' => function (&$tag, &$data, $disabled)
{
$data = strtr($data, array('<br>' => ''));
if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
$data = 'http://' . $data;

$data = get_proxied_url($data);
},


The third one also refers to the file ./Sources/Subs.php:

Search:
'content' => '<img src="$1" alt="" class="bbc_img" />',
'validate' => function (&$tag, &$data, $disabled)
{
global $image_proxy_enabled, $image_proxy_secret, $boardurl;

$data = strtr($data, array('<br>' => ''));
if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
$data = 'http://' . $data;

if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
$data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);
},


Replace:
'content' => '<img src="$1" alt="" class="bbc_img" />',
'validate' => function (&$tag, &$data, $disabled)
{
$data = strtr($data, array('<br>' => ''));
if (strpos($data, 'http://') !== 0 && strpos($data, 'https://') !== 0)
$data = 'http://' . $data;

$data = get_proxied_url($data);
},

Horme Gaming

Here you go,  issue was one of your mods nCode Image Resizer modified the code that was being searched for, best advice for future is if you are getting errors uninstall the mods then try as usually is a mod causing the issue :)

jamesbond007

Hi Deaks, thank you very much for your answer. I understand that I should uninstall the mod "nCode Image Resizer" and then the update should work without any issues, which I will try shortly.

Can I install this same mod again after having updated to 2.0.17?

Horme Gaming

yes :)

Also a good idea when you upgrade that you have the most uptodate versions of the mods installed as well.

jamesbond007

I uninstalled the mod "nCode Image Resizer" and tried to run the update to 2.0.16 again.

Result:

  • The first failed test is still there.
  • The second and the third failed tests have disappeared.
So the question remains: How do I get rid of the first failed test refering to the file ./Sources/QueryString.php? Do I have to uninstall more mods? And if yes: Which ones?

Horme Gaming

if you only have those 4 mods then I would uninstall those 4 mods, all them will work on SMF 2.0.17 you will just need to install 2.0a of nCode Image Resizer.

Their is a more extreme route that we can try if you are up for it.

Doug Heffernan

Quote from: jamesbond007 on June 05, 2020, 06:03:21 AM
I uninstalled the mod "nCode Image Resizer" and tried to run the update to 2.0.16 again.

Result:

  • The first failed test is still there.
  • The second and the third failed tests have disappeared.
So the question remains: How do I get rid of the first failed test refering to the file ./Sources/QueryString.php? Do I have to uninstall more mods? And if yes: Which ones?

You can add the code manually for the failed file. However, the best way imo would be to overwrite all your forum files with the files from the large 2.0.17 large upgrade package.

Like that all your mods will be uninstalled, but you can re install them later. Another thing to keep in mind is if you have done manual edits to the files, make a note of them as they will be gone too. You can readd them too afterwards.

jamesbond007

June 05, 2020, 09:50:10 AM #8 Last Edit: June 05, 2020, 10:06:00 AM by jamesbond007
Thanks very much for you help, Deaks and doug_ips.

I proceeded like Deaks suggested and uninstalled my remaining three mods. (Originally I was reluctant to uninstall SimplePortal, but as all its data is stored in database tables, this seems to be safe.)

After that updating SMF to 2.0.16 and 2.0.17 worked without any issues. Next I checked for the latest version of every mod and installed them again. This also worked out as expected and without any problems.

Thanks again - topic is solved!

(Marked this thread as solved.)

Advertisement: