home forums resources search newsjoinmembers: 6956
Sections PHP Flash Java Ruby Windows Linux
Carl's picture

Carl | Sat, 2005-12-17 11:29  tags: , ,

Drupal 4.5.2 is not php5 out of the box. This archive contains the php5 compatible files that are used at Hivemindz Magazine.

This compressed archive contains the includes and modules folders from this site which is running Drupal 4.5.2 on PHP5. Updates to this archive will be made periodically as fixes for the errors that occur in Drupal and it's modules when run under PHP 5.0.3 and later.

File: login or register to download  Author:Carl McDade

Carl's picture
Ten years of experience in web development. Carl is looking for in employment as a Senior PHP/mySQL Developer in Stockholm.
Carl McDade - Systems Developer
Thoughtbox - So what did you think?



Carl posted on: Tue, 2005-01-04 18:15.

line: 210
status: not in archive

<?php

if ($fsitem == FALSE) {
      
$fsitem = (object)"";// fixed from $fsitem = "";
      
$fsitem->cachename _fscache_build_name();
      
$fsitem->size $_FILES["edit"]['size'][$field];
      
$fsitem->md5 $md5;
?>

Carl posted on: Tue, 2005-01-04 21:37.

taxonomy module line:910
status: new not added to archive

<?php

case 'page':
        
// Build breadcrumb based on first hierarchy of first term:
        
$current = (object)'';//new object her to fix error
        
$current->tid $tids[0]; // error here
        
$breadcrumbs = array(array('path' => $_GET['q']));
        while (
$parents taxonomy_get_parents($current->tid)) {
          
$current array_shift($parents);
?>

Carl posted on: Wed, 2005-01-05 13:05.

status: not in archive

strict warning: Creating default object from empty value in /home/mcdadehm/public_html/hm/modules/node.module on line 397.

This may happen to both if statements so the fix includes line 391 also.

<?php

// Call the node specific callback (if any) and piggy-back the
  // results to the node or overwrite some values.
  
if ($extra node_invoke($node'load')) {
    foreach (
$extra as $key => $value) {
      
$node->$key = (object)'';
      
$node->$key $value;
    }
  }
  if (
$extra node_invoke_nodeapi($node'load')) {
    foreach (
$extra as $key => $value) {
      
$node->$key = (object)'';
      
$node->$key $value;
    }
  }
?>

Carl posted on: Wed, 2005-01-05 20:59.

Since there have been no directly reported errors here and the error logs at this site are not showing any notices I will release v.002 . From this point on updates will be weekly if there are any. So far Drupal is responding well to the slight changes in code and no failures or fatal errors have occured.

Carl posted on: Fri, 2005-01-07 12:05.

My two year old hit the keyboard and caused a code line to jump out of place in the forum module. Fixed now and the release is now in plain zip compression format as the rar format was not generic enough.

I also changed the filestore 2 module to require permission for download. There will be more Drupal goodies for developers forth coming so no more anonymous downloads.

Carl posted on: Sun, 2005-01-09 03:53.

status: not in archive
line: 627 xmlrpc.inc

I got a type casting error because the xmlrpc.inc uses the resource handle to create and array key. Bad idea.

the bugged code.

<?php

$parser 
drupal_xml_parser_create($data);
    
$_xh[$parser]=array();
    
$_xh[$parse]['st']="";
    
$_xh[$parser]['cm']=0;
    
$_xh[$parser]['isf']=0;
    
$_xh[$parser]['ac']="";
    
$_xh[$parser]['qt']="";
    
$_xh[$parser]['ha']="";
    
$_xh[$parser]['ac']="";
    
xml_parser_set_option($parserXML_OPTION_CASE_FOLDINGtrue);
    
xml_set_element_handler($parser"xmlrpc_se""xmlrpc_ee");
    
xml_set_character_data_handler($parser"xmlrpc_cd");
    
xml_set_default_handler($parser"xmlrpc_dh");
    
$xmlrpc_value=new xmlrpcval;
?>

the fix

<?php

$parser 
drupal_xml_parser_create($data);
    
$parserKey = (int)$parser;
    
$_xh[$parserKey]=array();
    
$_xh[$parserKey]['st']="";
    
$_xh[$parserKey]['cm']=0;
    
$_xh[$parserKey]['isf']=0;
    
$_xh[$parserKey]['ac']="";
    
$_xh[$parserKey]['qt']="";
    
$_xh[$parserKey]['ha']="";
    
$_xh[$parserKey]['ac']="";
    
xml_parser_set_option($parserXML_OPTION_CASE_FOLDINGtrue);
    
xml_set_element_handler($parser"xmlrpc_se""xmlrpc_ee");
    
xml_set_character_data_handler($parser"xmlrpc_cd");
    
xml_set_default_handler($parser"xmlrpc_dh");
    
$xmlrpc_value=new xmlrpcval;
?>

Carl posted on: Thu, 2005-01-13 08:51.

The xmlrpc.inc file has some serious issues with type casting of resource handles. It is going to take some time but I will get it straightened out soon.

Carl posted on: Wed, 2005-01-19 21:09.

Well xmlrpc.inc seems to be working great and there have not been any red lines in watchdog or errors in the apache logs. So v.004 Drupal 4.5.1 for PHP5 is up and ready for download.

So far no one has sent any other errors and since there have been none seen at Drupal.org that are PHP5 based, this may be the last release for 4.5.1. At this point I will wait for Drupal 4.6 to be released.  There will be no fixes made to minor point releases after 4.5.1 and before 4.6.

Enjoy!

Carl posted on: Sun, 2005-01-23 20:44.

I just noticed  while doing a check on the blogapi.module that xmlrcp.inc throws lots of errors when the blogapi.module connects. So I am going to do a line by line fix for this as many errors occur within a switch case function. It seems that the global fixes are being ignored by the switches. 

Carl posted on: Sun, 2005-02-13 12:33.

Well I was forced to do a newer version because of a bug in the xmlrpcs.inc file. This only appeared when using a desktop blog client. When using the w.blogger client there were other things happening that needed to be fixed I thought. As it turned out it was a matter of non-information and lack of documentation which was the problem. I have since fixed this with a tutorial and then fixed xmlrpcs.inc also.




 
CMS Comparison Matrix

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.