[SOLVED|Moved server install: new problem with youtubeplayer

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
trogfish
New Member
New Member
Posts: 8
Joined: Fri Feb 20, 2009 2:21 am

[SOLVED|Moved server install: new problem with youtubeplayer

Post by trogfish »

I recently moved my CMSMS install to a new server setup.
The old setup was debian lenny with apache and php5.2.
The new setup is very similar ubuntu with apache and php5.3.

I barely use any functionality of youtubeplayer module, only for conveniently encoding youtube links within the cmsms site.

However, since the move, I am getting lots of this in my error.log

Code: Select all

[Wed Jul 20 03:11:58 2011] [error] [client 75.160.xxx.xx] PHP Notice:  Undefined variable: userids in snipped/public/modules/youtubeplayer/lang/en_US.php on line 276
[Wed Jul 20 03:11:58 2011] [error] [client 75.160.xxx.xx] PHP Notice:  Undefined variable: userids in snipped/public/modules/youtubeplayer/lang/en_US.php on line 287
[Wed Jul 20 03:12:01 2011] [error] [client 75.160.xxx.xx] PHP Notice:  Undefined variable: userids in snipped/public/modules/youtubeplayer/lang/en_US.php on line 276, referer: http://crptruck.com/
[Wed Jul 20 03:12:01 2011] [error] [client 75.160.xxx.xx] PHP Notice:  Undefined variable: userids in snipped/public/modules/youtubeplayer/lang/en_US.php on line 287, referer: http://crptruck.com/
I looked at those lines in the en_US.php, but I don't know what to do with them..... I am guessing it may be the change to php5.3; which I need for a different project...

If anyone can point out some help or a fix, I'd appreciate it. Thanks!
trogfish
New Member
New Member
Posts: 8
Joined: Fri Feb 20, 2009 2:21 am

Re: [SOLVED|Moved server install: new problem with youtubepl

Post by trogfish »

So, upon further inspection the offending section was part of a 'help' that was giving code examples of how to use the module. Somehow example code was not escaped enough for PHP5.3, and throwing the errors. I just deleted the section, and all is well.
10010110
Translator
Translator
Posts: 210
Joined: Tue Jan 22, 2008 9:57 am

Re: [SOLVED|Moved server install: new problem with youtubepl

Post by 10010110 »

I experienced this issue, too. The problem is the use of double quotes for the language strings:

Code: Select all

----------------v here
$lang["help"] = "<h3>What Does This Do?</h3>
				<p>This module manages…
In PHP single quotes and double quotes are treated differently in that variables in strings that are defined in double quotes are parsed while they are printed as they are in single quotes:

Code: Select all

$var = 1;
$string1 = "I’m text and this is a variable: $var"; // Resulting text is “I’m text and this is a variable: 1”
$string2 = 'I’m text and this is a variable: $var'; // Resulting text is “I’m text and this is a variable: $var”
So, to avoid the above mentioned error without removing any important info from the language file you can change the surrounding double quotes of the string to single quotes. This way you can also remove all these escape backslashes for the occurrences of double quotes in that string. However, look for other occurrences of other single quotes inside the string and escape them appropriately.
Post Reply

Return to “Modules/Add-Ons”