Hello All,
I installed the Playa extension today, and when I try to publish a weblog with a playa field, all I get is a blank white screen. I noticed that the URL is missing some data as well. If I publish a plain weblog with no playa fields, everything works and the URL looks like this:
http://www.examplesite.com/admin_login/index.php?S=0&C=edit&M=view_entry&weblog_id=12&entry_id=39&U=update
But, when I try to publish a weblog with a playa field, the URL looks like this and the screen is blank:
http://www.examplesite.com/admin_login/index.php?S=0&C=edit&M=new_entry
Has anyone ran into this before?
Okay, so I took at look at my error logs when the blank page appears and this is the error that is being thrown.
[client xxx.xx.xxx.xxx] PHP Fatal error: Call to undefined function: str_split() in /var/www/vhosts/ccialaska.com/httpdocs/cci_login/extensions/ext.playa.php on line 642, referer: http://www.ccialaska.com/cci_login/index.php?S=6964679a30d3d065e06e4cf521e2e351cf1db7ce&C=edit&M=edit_entry&weblog_id=12&entry_id=38
Does that help?
So, I still can’t get this to work with PhP4. I tried the multi-relationship fix for PhP4 that was discussed, and that did not have any affect. I still get the blank page when publishing. What is weird though is that the entry is still submitted to the database. I can go to the edit page and find the entry that was published, but the playa field does not retain the value.
I remeber reading on the previous versions of Playa that we had to place the play extension and folder into the utilities folder, do we still need to do this?
I wish I could get this working. I would just upgrade to php5, but I am currently on a DV at media temple and there are a few other sites on that server that have been there for awhile and require php4 for their CMS.
okay, so the str_split function is what is causing the problem I took the original code around line 642:
foreach(str_split($title) as $char) {
if (in_array(strtolower($char), $whitelist)) $simpleTitle .= $char;
}
and wrapped it in a if statement that checks to see if that function exisits:
if (function_exists ('str_split')) {
foreach(str_split($title) as $char) {
if (in_array(strtolower($char), $whitelist)) $simpleTitle .= $char;
}
}
I can now publish and edit with playa fields, but only the related ID is being returned. I have been looking around for str_split replacements for php4 and haven’t found anything that works yet. Does anybody have an idea how to rewrite that function for php4?
All right, I have it figured out.
Here is my updated code to make Playa work with php4 while still playing nice with php5.
if (function_exists ('str_split')) {
foreach(str_split($title) as $char) {
if (in_array(strtolower($char), $whitelist)) $simpleTitle .= $char;
}
} else {
$array = explode("\r\n",trim(chunk_split($title,1)));
foreach($array as $char) {
if (in_array(strtolower($char), $whitelist)) $simpleTitle .= $char;
}
}
This would replace the original code:
foreach(str_split($title) as $char) {
if (in_array(strtolower($char), $whitelist)) $simpleTitle .= $char;
}
I am now a happy guy that this works.
I’ve been having the same problem, but when I made the code change you suggested above, the output to the template looks like this (projectsPipeline is my Playa field name):
{REL[14][projectsPipeline]SMNxRrizREL}
[14] is indeed the right id for the entry I’m trying to pull from the Playa field. Guess it’s just the display that’s hosed. Any clue how to fix this? I’m using Playa 1.3.3, PHP 5 and the only other non-stock extension I’m using is Mark Huot’s “File” extension.
UPDATE: Turns out my hosting provider said I had PHP 5, but I didn’t. And since the Playa extension requires PHP 4, that was the problem. For anyone else having this issue, tune into Mark Huot’s post on this thread about solving the REL issue (it worked for me):
http://ellislab.com/forums/viewthread/39595/P18/#192755
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.