Hello,

First of all, thank you for the great module!

If I enable the default image, I get an error stating that on 177 the function unlink can not be found, but I only got that the first time.

Basically, everything works fine, exept when I display the default fields with imagecache. They just don't show. Everything shows, except the default images. Any ideas?

Comments

dopry’s picture

You will need to go and update/reset all the formatters on admin/content/types/$type/display. It seems I missed this part of the upgrade path. I'll try to figure out a way to correct when I'm working on imagefield next this weds, but it is easily curable by updating the display settings page, if tedious.

dopry’s picture

Title: Default image doesn't show with imagecache » Fix imagefield 1.x ->2.x upgrade path. Rename default formatters from $name to $name .'_default'.
Version: 5.x-2.0-rc8 » 5.x-2.1

The new formatter handling code changed the name of the default formatter to from $preset['name'] to $preset['name'] .'_default'. This applies to both imagefield and imagecache. The update function should iterate over all function types, updating the formatter name if it hasn't been updated already.

dorien’s picture

Thanks for your reply.

I have just upgraded from 2.0-rc8 to 2.1. However, the ajax upload seems to be broken now! But only for imagefield uploads. It keeps on displaying the loading bar.

If I go to the display options of my content type, I cannot see this default handler that you talk about.

jpetso’s picture

> However, the ajax upload seems to be broken now! But only for imagefield uploads. It keeps on displaying the loading bar.

I bet three euros that you've got the Devel module enabled, which causes AJAX uploads (not only those in imagefield, but also in upload.module and filefield) to stall.

dorien’s picture

I have :-)
I will disable it and let you know if that solves it. Thanks for the tip!

dorien’s picture

Status: Active » Fixed

Excellent!

dopry’s picture

Status: Fixed » Active

Sorry.. this is still active as there is an involved upgrade path that needs to be fixed as well...

kulfi’s picture

No images are displayed in 'view' mode. Devel is not enabled.

bwood’s picture

I bet three euros that you've got the Devel module enabled, which causes AJAX uploads (not only those in imagefield, but also in upload.module and filefield) to stall.

Thank you! I was about to do drastic things. I guess I missed that in some Devel documentation...

smk-ka’s picture

Assigned: Unassigned » smk-ka
Status: Active » Needs review
StatusFileSize
new1.29 KB

Implemented the update path as outlined in #2. However, I think the name of the default formatter changed from just 'default' to 'imagefield_default', don't know where $preset['name'] fits in there.

smk-ka’s picture

StatusFileSize
new1.4 KB

Added clearing of content type cache after update.

liquidcms’s picture

Priority: Normal » Critical

i think imagefield still has a bug trying to load default image.. all i see on node_load() for a field with no image but with a defauklt.. is that the field is not populated into the node object.

also, patch in #11 fails on call to undefined function _content_admin_display_contexts()

how is it this hasn't been sorted out.. doesnt everyone use this module???

bomarmonk’s picture

Duplicate? This patch worked for me: http://drupal.org/node/318058

drewish’s picture

Version: 5.x-2.1 » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)
StatusFileSize
new1.89 KB

I committed the attached to HEAD so that it'd stay consistent.

drewish’s picture

Title: Fix imagefield 1.x ->2.x upgrade path. Rename default formatters from $name to $name .'_default'. » Fix imagefield 1.x -> 2.x upgrade path. Rename default formatters from $name to $name .'_default'.
Version: 6.x-3.x-dev » 5.x-2.x-dev
Status: Patch (to be ported) » Fixed

committed smk-ka's patch to DRUPAL-5--2.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

caktux’s picture

Status: Closed (fixed) » Needs review
StatusFileSize
new680 bytes

The same problem applies to default Views (5.x) formatters, this patch fixed every view I had that used imagefield.

caktux’s picture

StatusFileSize
new713 bytes

nice, wrong way patch... sorry

drewish’s picture

Status: Needs review » Needs work

i think we could do without the first place holder ala:

+    if (module_exists('views')) {
+      db_query("UPDATE {view_tablefield} SET options = 'imagefield_default' WHERE field = '%s_fid' AND options = 'default'", $row['field_name']);
+    }

also how about making it into a separate update?

caktux’s picture

StatusFileSize
new931 bytes

without first placeholder and as a separate update

note: The same thing would need to be done for every imagecache presets' defaults (ie. "YourImagecachePreset" for "YourImagecachePreset_default"), or you have to manually edit your view and re-set it.

quicksketch’s picture

Status: Needs work » Fixed

caktux, this change is no longer necessary after #402200: Restore the "default" Formatter. This whole changing the name of the default formatter was a bad idea from the start.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.