Radicore Forum - RDF feed
type: channel
description: Fast Uncompromising Discussions. FUDforum will get your users talking.
items: BUG+FIX: error generated in _cm_pre_updateRecord gives 'blank' screen
items: Re: BUG+FIX: error generated in _cm_pre_updateRecord gives 'blank' screen

BUG+FIX: error generated in _cm_pre_updateRecord gives 'blank' screen
type: item
description: When you generate an error in _cm_pre_updateRecord function ($this->errors['xx']=...), you will get the updatescreen back but without any data. The problem is that the fieldarray data is lost when the fieldarray is merged with the non-existant updatearray in function updateRecord $fieldarray = array_merge($fieldarray, $updatearray); I put this at the beginning of the updateRecord function: $updatearray=Array(); This solves the problem, probably because $updateArray is now an array. Previously it was nothing, so PHP probably defaulted to a string. I use PHP 5.2.0 on Mac OS X 10.4
creator: janalwin
date: 2007-02-23T16:54:34-00:00

Re: BUG+FIX: error generated in _cm_pre_updateRecord gives 'blank' screen
type: item
description: Thanks for spotting that. I will include the fix in the next release. This problem did not exist in PHP 4 as the array_merge() function would automatically cast any non-array argument to an array, but one of those dunderheads in the PHP development team decided to remove this "feature" in PHP 5. His reasoning was that if a function expects an array then giving it something which is not an array is a fault. That is the way that "proper" languages work, so PHP should be just the same. These ideas of purity and strictness are a real PITA. PHP used to be very forgiving by automatically changing a variable's type to suit the circumstances, but now code that worked in PHP 4 does not work in PHP 5. Is it any wonder that the take-up of PHP 5 has been so slow when there have been so many unnecessary breakages in backwards compatibility.
creator: AJM
date: 2007-02-23T17:12:36-00:00