Problem with .20 to .21 (error)

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
MaddoxX
Registered User
Posts: 450
Joined: Sat May 15, 2004 4:43 pm
Location: Russia

Problem with .20 to .21 (error)

Post by MaddoxX » Thu Jun 08, 2006 12:51 am

Fatal error: Call to undefined function: phpbb_ltrim() in /home/public_html/madcakes/includes/functions.php on line 438

did i miss something from an previous update that its undefined ?
(I redid my 2.0.20 3 times and still had the error... im sure i didnt do anything wrong)

edit: nvm.. i missed a part from phpbb 2.018:

/**
* This function is a wrapper for ltrim, as charlist is only supported in php >= 4.1.0
* Added in phpBB 2.0.18
*/
function phpbb_ltrim($str, $charlist = false)
{
if ($charlist === false)
{
return ltrim($str);
}

$php_version = explode('.', PHP_VERSION);

// php version < 4.1.0
if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))
{
while ($str{0} == $charlist)
{
$str = substr($str, 1);
}
}
else
{
$str = ltrim($str, $charlist);
}

return $str;
}
:D

shiner
Registered User
Posts: 370
Joined: Wed Mar 09, 2005 11:58 pm

Post by shiner » Thu Jun 08, 2006 1:34 am

Download a fresh copy of 2.0.21 and upload only functions.php and check if it works. :idea:

User avatar
Marshalrusty
Project Manager
Project Manager
Posts: 29247
Joined: Mon Nov 22, 2004 10:45 pm
Location: New York City
Name: Yuriy Rusko
Contact:

Re: Problem with .20 to .21 (error)

Post by Marshalrusty » Thu Jun 08, 2006 1:44 am

MaddoxX wrote: edit: nvm.. i missed a part from phpbb 2.018

:wink:
Have comments/praise/complaints/suggestions? Please feel free to PM me.

Need private help? Hire me for all your phpBB and web development needs

User avatar
Freitag
Registered User
Posts: 142
Joined: Mon Jul 11, 2005 10:17 pm

Post by Freitag » Sun Jun 11, 2006 5:58 am

I had the same problem and the same fix would have applied, except that it is a moderatly modded board and one of the mods that specifically uses the functions.php file is Simple Subforums (which the users just love).

Instead I copied that one function from .21 to the board.

I have been applying the patch files for the admin since update .15 and almost religiously checking the .rej files.

Is there some chance that the patch process can drop things? I regularly have only 1 line item in the .rej file and it is the file datastamp, which I dutifully update. Could these by symptoms of previously dropped patches?

I had two .rej on the trip from .20 to .21 and one of them was a datestamp only, the other was a datestamp and a regular expression line.

harpman
Registered User
Posts: 35
Joined: Thu Sep 16, 2004 8:30 pm

Post by harpman » Sun Jul 23, 2006 1:25 pm

Hi MaddoxX and Freitag,

Just thought I would say that I experienced exactly the same problem! I've been painstakingly applying each update since at least 2.0.16 as a Mod due to a number of MODs, some custom, and I seem to have been missing exactly the same function as you two!

Presumably it didn't really get used in 2.0.18-20 then since the error only just came up...

Anyway thanks MaddoxX for the convenience of posting the missing function here.... just pasted that into the right spot in my functions.php and life has returned to normal!

Cheers
[ Do I understand your question? Is it hopeless and forlorn? ]

ms009986
Registered User
Posts: 38
Joined: Fri Apr 08, 2005 1:14 am

Post by ms009986 » Mon Aug 14, 2006 12:13 pm

I had the same problem as well, I checked my functions file and didn't see that I'd ever made any customizations to it, so I replaced it. Once I'd done that, my board ran correctly.

I also don't know how this function went missing. I've had issues with a few lines of code being missing here and there since I started using EasyMod...I think I'm going to have to start doing my updates manually.

Before I came to this board to search for my particular error, I went through after I'd EasyModded my .21 update and checked each step individually...I found that, although this had nothing to do with the problem I was having, the final step in the update had NOT been done, even though EasyMOD reported that all files had been modified successfully.

Also it seems that EasyMOD for some reason inserts blank lines everywhere...many of my files look like they're quadruple-spaced. Not that this affects the functioning of phpbb, but still, it looks bad and when you're given a line number as a reference it's useless.

Chris

Locked

Return to “2.0.x Support Forum”