If I remove code from a droplet and re-add it show invalid php code :?
Hi,
Quote from: N1kko on September 30, 2013, 10:43:14 AM
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
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 :?
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
I'm running PHP Version 5.3.17
Droplet says invalid php code
Thanks
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 ..
Quote from: N1kko on October 01, 2013, 11:16:43 AM
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
QuoteParse 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
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
Saying SearchBox droplet is invalid
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.\' /> \';
$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
Search box droplet throwing this error
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING in /home/site/public_html/modules/droplets/droplets.php(37) : eval()'d code on line 3
Quote from: N1kko on October 01, 2013, 02:26:33 PM
Saying SearchBox droplet is invalid
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.\' /> \';
$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
Quote from: badknight on October 01, 2013, 02:39:06 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
Here's my servers phpinfo as pdf magic quotes is off :?
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:
If I add the droplet in phpmyadmin it works fine as it doesn't add the slashes. So is it magic quotes causing this?
Reinstalled WB Seems to be fine now... Strange Thanks for all the help :-D