PHP4 Compatibility issue

teknocat - July 20, 2009 - 18:04
Project:Simplenews Template
Version:5.x-1.4
Component:Code
Category:bug report
Priority:normal
Assigned:teknocat
Status:needs review
Description

I discovered a line of code in simplenews_template.inc that only works in PHP5. It was line 79 where it gets the newsletter name from taxonomy. It tries to use an object operator directly on the return value of the taxonomy_get_term function which only works in PHP5 (taxonomy_get_term($tid)->name). The solution for PHP 4 is to break it into a couple of lines, first putting the object returned by the taxonomy_get_term object into a variable then calling the object's "name" property on that variable. The attached patch file contains this fix.

AttachmentSize
simplenews_template_php4_fix.diff797 bytes

#1

teknocat - July 20, 2009 - 18:18

#2

leeomara - July 20, 2009 - 19:39
Status:active» needs review
 
 

Drupal is a registered trademark of Dries Buytaert.