WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Droplets & Snippets => Topic started by: N1kko on September 30, 2013, 10:43:14 AM

Title: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on September 30, 2013, 10:43:14 AM
If I remove code from a droplet and re-add it show invalid php code  :?
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: marmot on September 30, 2013, 09:13:06 PM
Hi,

If I remove code from a droplet and re-add it show invalid php code  :?
as I can see no use in removing something and adding the same again, just leave the droplet as it is :).

regards
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on September 30, 2013, 10:30:14 PM
I deleted a couple which I didn't think I would need but decided to add again that's when the error occurred. So somethings not right  :?
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: ruebenwurzel on October 01, 2013, 07:10:24 AM
Hello,

wich PHP Version is running on your server?
What exactly are the messages?

Rev. 1638 didn't fully support PHP 5.x. F.e. some droplets produces error messages when installing them. This is fixed in the upcoming WB 2.8.4.

Matthias
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 11:16:43 AM
I'm running PHP Version 5.3.17
Droplet says invalid php code

Thanks
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: badknight on October 01, 2013, 11:28:23 AM
take a look at the php - info
is magic_quotes_gpc on? (http://php.net/manual/en/security.magicquotes.php)

show us the droplet - code ..
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: jacobi22 on October 01, 2013, 12:14:57 PM
I'm running PHP Version 5.3.17
Droplet says invalid php code

not more?

put the Droplet-Code from the "error-droplet" in an page, like this here [[Lorem?blocks=6]]
look in Settings -> Advanced Setting and set PHP ERROR MESSAGES to ON

start the page with the droplet code in the frontend and you have a error messages like this

Quote
Parse error: syntax error, unexpected 'global' (T_GLOBAL) in G:\cms\wb_test_1532\modules\droplets\droplets.php(37) : eval()'d code on line 5

look to eval()'d code on line (here line 5)
then go back to the error Droplet in Admin Tools -> Droplet and look to the line from the error message

for a test i delete the slash in Line 1  from the sectionPicker-droplet
thats my (wrong) code now - no Slash's for the comment in line 1
Code: [Select]
SectionPicker
//Load the view.php from any other section-module, including the frontend.css
//Use [[SectionPicker?sid=123]]

global $database, $wb, $TEXT, $DGTEXT,$section_id,$page_id;

the first working line is line 5 and php doesnt know what "global" is, so it give's a syntax error, unexpected 'global' and the script stops here.

i know, line 5 is ok, line 4 is empty, line 2 and line 3 are a comment, the error must be in line 1
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 02:26:33 PM
Saying SearchBox droplet is invalid

Code: [Select]
global $TEXT;
$return_value = true;
if (!isset($msg)) $msg=\'search this site..\';
$j = \"onfocus=\\\"if(this.value==\'$msg\'){this.value=\'\';this.style.color=\'#000\';}else{this.select();}\\\"
onblur=\\\"if(this.value==\'\'){this.value=\'$msg\';this.style.color=\'#b3b3b3\';}\\\"\";
if(SHOW_SEARCH) {
$return_value  = \'<div class=\"searchbox\">\';
$return_value  .= \'<form action=\"\'.WB_URL.\'/search/index\'.PAGE_EXTENSION.\'\" method=\"get\" name=\"search\" class=\"searchform\" id=\"search\">\';
$return_value  .= \'<input style=\"color:#b3b3b3;\" type=\"text\" name=\"string\" size=\"25\" class=\"textbox\" value=\"\'.$msg.\'\" \'.$j.\'  />&nbsp;\';
$return_value  .= \'</form>\';
$return_value  .= \'</div>\';
}
return $return_value;

The server is running PHP 5.4.20

I have set php error messages to E_All and I also have E_ALL ->PHP5.3.17 as an option
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 02:29:40 PM
Search box droplet throwing this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHIT ESPACE, expecting T_STRING in /home/site/public_html/modules/droplets/droplets.php(37) : eval()'d code on line 3
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: badknight on October 01, 2013, 02:39:06 PM
Saying SearchBox droplet is invalid

Code: [Select]
global $TEXT;
$return_value = true;
if (!isset($msg)) $msg=\'search this site..\';
$j = \"onfocus=\\\"if(this.value==\'$msg\'){this.value=\'\';this.style.color=\'#000\';}else{this.select();}\\\"
onblur=\\\"if(this.value==\'\'){this.value=\'$msg\';this.style.color=\'#b3b3b3\';}\\\"\";
if(SHOW_SEARCH) {
$return_value  = \'<div class=\"searchbox\">\';
$return_value  .= \'<form action=\"\'.WB_URL.\'/search/index\'.PAGE_EXTENSION.\'\" method=\"get\" name=\"search\" class=\"searchform\" id=\"search\">\';
$return_value  .= \'<input style=\"color:#b3b3b3;\" type=\"text\" name=\"string\" size=\"25\" class=\"textbox\" value=\"\'.$msg.\'\" \'.$j.\'  />&nbsp;\';
$return_value  .= \'</form>\';
$return_value  .= \'</div>\';
}
return $return_value;

The server is running PHP 5.4.20

I have set php error messages to E_All and I also have E_ALL ->PHP5.3.17 as an option

the Server is right - it is invalid ;)
Thats not a WB Problem - thers a problem with the server configuration ... e.g. http://php.net/manual/en/security.magicquotes.php unter php 5.3...

if you enter a String in the textarea (e.g. $myVar = 'Test';)
the server save this as $myVar = \'Test\'; <= and thats the problem
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: jacobi22 on October 01, 2013, 02:43:02 PM

the Server is right - it is invalid ;)
Thats not a WB Problem - thers a problem with the server configuration ... e.g. http://php.net/manual/en/security.magicquotes.php unter php 5.3...

if you enter a String in the textarea (e.g. $myVar = 'Test';)
the server save this as $myVar = \'Test\'; <= and thats the problem


the droplet code works without problem
its exact the same code in wb 2.8.4
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 02:46:06 PM
Here's my servers phpinfo as pdf magic quotes is off  :?

Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 02:53:13 PM
Not sure what I need to do really. As far as I'm aware magic quotes is off on the server.

Thanks for your help guys  :wink:
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 03:07:01 PM
If I add the droplet in phpmyadmin it works fine as it doesn't add the slashes. So is it magic quotes causing this?
Title: Re: WB 2.8.3 [R1638] SP1 Droplet Errors
Post by: N1kko on October 01, 2013, 03:37:14 PM
Reinstalled WB Seems to be fine now... Strange Thanks for all the help  :-D