Hi all,

I recently upgraded to PHP 5 and it broke some of my Drupal sites. They're all Drupal 4.6.3. They're displaying stuff like this:

{head} {styles}
Skip navigation.
{_BLOCK_.header.logo} {_BLOCK_.header.site_name} {_BLOCK_.header.site_slogan} {primary_links}
{secondary_links} {_BLOCK_.header.search_box}
{_BLOCK_.header.blocks} {_BLOCK_.footer.blocks}
{_BLOCK_.header.mission}

My PHPTemplate sites seem to be relatively immune to this problem, which is good because these are my best sites.

Any ideas? Thanks.

Comments

t4him’s picture

Read this post. It should help.

blarg’s picture

It's because XTemplate doesn't work with PHP5. More direct link here.

mjolley@buy-hot.com’s picture

Sorry I didn't find it myself but I did try.

So no more Pushbutton for me. I guess that's just as well :)

sepeck’s picture

There is a ported PushButton phptemplate based version.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

mjolley@buy-hot.com’s picture

I moved my PushButtons to FriendsElectric. PushBitton was ok, but too wide for most people.

It's annoying when a technology obsoletes another, but given the work I was doing before I discovered Drupal, I'm not going to complain.

sepeck’s picture

Heh, well when php5 first came out, everything worked. php5.0.5 and 5.1 changed some things unexpectatly on us.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

Sakuza@projects.sakuza.com’s picture

I have made patch for this bug and now it seems to work correctly with all PHP versions. There was just unreported bug in function str_replace().

Blog entry: http://projects.sakuza.com/node/152
Direct download: http://projects.sakuza.com/system/files?file=xtemplate_patch_for_php5.zip

Greetings from Estonia

heine’s picture

Great,

Can you file an issue against XTemplate and make & post a proper patch?

Thanks
--
Tips for posting to the forums.
When your problem is solved, please post a follow-up to the thread you started.

fuzzie’s picture

I can't seem to get to this patch.
Can you send it to me?
fuzzie_at_vohslaw_dot_com
Thanks!

fuzzie’s picture

Had a buddy look into this, and he was able to fix it for me. This is what he said:

"str_replace() wasn't acting properly. I replaced it with preg_replace in xtemplate.inc, and everything is working fine. Simply open up xtemplate.inc and replace the two lines that say:

$copy=str_replace("\{$v\}",$var,$copy);

with:

$copy = preg_replace("/\{".addslashes($v)."\}/", $var, $copy);

And you should be all set. Should work with any version of PHP5, I'd expect."

pamphile’s picture

I'll give that a try

Marcel
http://tinyhttp.com - url shortening service