This fixes a few PHP Notices in 4.7 image.module when run with error reporting set to E_ALL.
The changes are designed to apply without changing any line numbering or any functional behaviour, in an attempt to be as separable as possible from other patches. It does mean many are of the form (isset($x) ? $x : NULL) which is not very pretty.
Example fixes:
(1) Changed
$form[$i]['label'] = array(..., '#default_value' => $sizes[$i]['label'], ...); into
$form[$i]['label'] = array(..., '#default_value' => isset($sizes[$i]['label']) ? $sizes[$i]['label'] : NULL, ...);
(2) Changed
if (in_array($sizes[$i]['label'], _image_required_sizes())) { to
if (!empty($sizes[$i]['label']) && in_array($sizes[$i]['label'], _image_required_sizes())) {
(3) Changed
return $form; to
return isset($form) ? $form : NULL; where $form may not have been defined.
(4) Changed
if ($node->new_file) { to
if (!empty($node->new_file)) {
Other changes are of a similar style to these.
I know this will probably only be of interest to Drupal historians, but I'm still running 4.7 for now...
Mark.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | image_161063.patch | 4.52 KB | drewish |
| image.module.E_ALL.patch | 4.37 KB | plumbley |
Comments
Comment #1
drewish commentedcould you roll a patch? http://drupal.org/patch
Comment #2
plumbley commentedI attached at the top what I hoped was a valid patch for current 4.7 image.module (image 4.7.1-1.x released 2 Mar 2007). The patch begins as follows:
Does this look OK? (I'm on Windows so I dos2unix'd the line endings, but use TortoiseCVS so haven't apply -p). Mark
Comment #3
drewish commentedtotally my bad, for what ever reason the email notice i'd gotten didn't list the patch and i didn't double check before responding. i'll take a look at it.
Comment #4
drewish commentedone small change, don't bother testing that the form is set, only return it when it's set.
Comment #5
sunDevelopment and support for 4.7.x and 4.6.x has ended. You are strongly advised to upgrade to Drupal 5.x or 6.x.
Marking as won't fix.