Download & Extend

Node submission fails when CCK is not installed

Project:File (Field) Paths
Version:6.x-1.2
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

First, my configuration: I am using FileField Paths to control file attachments made with the Upload module. I do not have CCK installed.

After upgrading FileField Paths to 6.x-1.2, submitting nodes with attachments causes a fatal PHP error:

Fatal error: Call to undefined function content_update() in E:\PAMPA\PAMPA\apache\htdocs\cto\modules\filefield_paths\filefield_paths.module on line 456

The reason: in 6.x-1.2, content_update(), a CCK function, is called for every node update--even when CCK isn't installed.

Attached is a tiny patch that fixes the issue by making sure that CCK exists before calling content_update(). This is the same exception found in the 6.x-1.1 version.

AttachmentSize
filefield_paths_no_cck_fix.patch408 bytes

Comments

#1

Hi prof1337,

Thanks for pointing this out.

The fix, while it works for you in this case, is actually wrong as it would never be TRUE even if you where using FileField to upload, a better exception would be:

      if (module_exists('content')) {
        content_update($node);
      }

Again, thank you for pointing out the issue and it will be committed very shortly.

Cheers,
Deciphered.

#2

Status:needs review» fixed

Again, I have to apologize, this really was a massive oversight and is completely inexcusable.

Has been committed to DRUPAL-6--1 and DRUPAL-5, dev builds should be out shortly.

Have begun work on some simpletests so an issue like this should never occur again.

Cheers,
Deciphered.

#3

@Deciphered: Thanks for the quick response. The new dev version works perfectly.

#4

Status:fixed» closed (fixed)

That is fantastic news :)

nobody click here