It seems that whenever you attempt to save a PHP bloc now, it is attempting to escape the enitre body of the bloc. PHP code.... and this results in a completely non-functional bloc. The only way I've found to get around this is to edit the database records for the bloc directly. But this sorta circumvents the whole point of having TinyPortal.
Here is an example of what's happening:
This is some sample bloc that is what I type into the body...
...
//Display it all, with one piece of code?
echo "\n\n";
echo "<script type=\"text/javascript\" src=\"/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
echo "<div id=\"overDiv\" style=\"background-color: #000; border-color: #FFF; color: #FFF; position:absolute; visibility:hidden; z-index:1000;\"></div>\n";
foreach ($zonevar as $zoneVal)
{
if ($status[$zoneVal] == 1)
{
$strOut = "";
foreach($$zoneVal as $value)
{
$normal_mode = ($value['1'] == 1) ? "<span " . $Ndead . ">N</span>" : "<span " .$Nlive . ">N</span>";
$strOut = $strOut . "<div " . $boss . ">";
if($value['2'] == '0')
{
...
Here's what TinyPortalBeta5 is doing to the same bloc of code when it saves it:
//Display it all, with one piece of code?
echo \"\\n\\n\";
echo \"<script type=\\\"text/javascript\\\" src=\\\"/overlib.js\\\"><!-- overLIB (c) Erik Bosrup --></script>\\n\";
echo \"<div id=\\\"overDiv\\\" style=\\\"background-color: #000; border-color: #FFF; color: #FFF; position:absolute; visibility:hidden; z-index:1000;\\\"></div>\\n\";
foreach ($zonevar as $zoneVal)
Ã,«
if ($status[$zoneVal] == 1)
Ã,«
$strOut = \"\";
foreach($$zoneVal as $value)
Ã,«
$normal_mode = ($value[\'1\'] == 1) ? \"<span \" . $Ndead . \">N</span>\" : \"<span \" .$Nlive . \">N</span>\";
$strOut = $strOut . \"<div \" . $boss . \">\";
if($value[\'2\'] == \'0\')
Ã,«
$strOut = $strOut . \"<span \" . $Hlive . \">H</span>\";
Ã,»
Why are PHP blocs being parsed like this?
I take it you upgraded from TP Beta 4?
That's correct. I upgraded, and none of my existing blocs are broken. It's only when I attempt to go in and edit them that there is a problem.
Did you uninstall Beta 4 First? before installing beta 5?
No. I followed the instructions for upgrading beta 4 to beta 5. There was no mention of uninstalling Beta 4.
Should I have uninstalled beta 4 first?
Quote from: chronosis on April 03, 2010, 01:20:21 AM
No. I followed the instructions for upgrading beta 4 to beta 5. There was no mention of uninstalling Beta 4.
Should I have uninstalled beta 4 first?
It does say uninstall previous versions. Yes, you should have uninstalled beta 4 first.
Actually, the instructions I saw when installing were to only uninstall versions prior to 1.0.4 - if you were running 1.0.4, then you could just use the package manager.
HOWEVER, I upgraded from 1.0.3b and yes, I did uninstall first before installing the new version.
I am having the exact same problem described as above.
When I type in or copy/paste code into a php block, it changes the { to << and inserts lots of additional \\\ characters which essentially break the block.
This is only affecting one block for me at the moment but it is an important one.
cheers
Leah
Quote from: chronosis on April 03, 2010, 12:41:31 AM
IThe only way I've found to get around this is to edit the database records for the bloc directly. But this sorta circumvents the whole point of having TinyPortal.
Thank you - I have been tearing my hair out over this and didnt think to just edit the record directly. It doesnt solve the problem but at least I have been able to get the block working again until I work out what has gone wrong with the TP upgrade.
Apart from this one glitch, all else looks good.
cheers
Leah
And actually, yes. I went back to look. The instructions do say explicitly that you can install version 1.0b5 overtop of 1.0b4 using the package manager. Which is exactly what I did.
Quote
How to install/upgrade?
Just use the package manager and it will find the old TP files, it will happily upgrade from TP beta4 - but from earlier versions you will need to un-install those first, then re-install beta5.
Note that TP is still considered as beta and it may still contain bugs. Make backups before attempting upgrade or install of TinyPortal.
In fact I had the package manager handle downloading the package and installing it as well. So, I don't buy that this is an upgrade issue, exactly.
This looks like a legitimate break due to the tables already existing in the database, or the files already existing in the directory tree.
In either case it looks like you'd have to remove the data tables and files for tiny portal and then install the new version fresh. Which is really undesirable, since I've got many blocs and articles I'll have to migrate into the new version and recreate by hand.
Quote from: Xarcell on April 03, 2010, 01:38:30 AM
Quote from: chronosis on April 03, 2010, 01:20:21 AM
No. I followed the instructions for upgrading beta 4 to beta 5. There was no mention of uninstalling Beta 4.
Should I have uninstalled beta 4 first?
It does say uninstall previous versions. Yes, you should have uninstalled beta 4 first.
QuoteFrom news page.
How to install/upgrade?
Just use the package manager and it will find the old TP files, it will happily upgrade from TP 1.0 betas - but from earlier versions you will need to un-install those first, then re-install beta5.
Tried this myself, and i couldn't access my home page after the upgrade. As it was a fresh install of smf 1.1.11 and tp 1.04 beta on my test site I though this would be the best time to try it. ???
It seems there is a problem with PHP saving in both articles and blocks. The reason you see conversion of {'s are that they interfere with the { used in SMF new db routines.
But as it seems, it creates more trouble than not. I will adress this and issue a update asap.
Thanks Bloc
I'd seen the nearly identical problem with PHP Article and had wondered if they were related. It's nice to finally have an answer to the issue. Like everyone else has said--Aside of a few issue, everything else looks great.
I take it this is why the Article rating and comments sections are missing for me too... I also uninstalled beta 4 before installing beta 5.
For those having broken stuff I've found that uninstalling beta 5 and then installing beta 4 again it fixes it... of course you have to remove the backslashes but it does work (or at least it did for my test site).
This is why it is better to run beta testing on a completely seperate site than your live one... Shi... errr... Bugs Happen! :D
Any news on the fix? Just started using TP the other day and liking what i've seen so far :)
Hello NTR,
Welcome to TinyPortal.
The latest version of TinyPortal is TP 1.0 beta 5-1, and was released on April 11th. It may or may not have fixed this issue. However, another update to version 1.0 beta 5.2 will soon be released, and if this issue wasn't fixed in the current version, it will certainly be fixed in the new update when it comes out.
ZarPrime