Hi again. :)

Another issue I have come across:
Node Reference. In the Content Type > Manage Fields > Edit Image Field options we see that we can expose certain fields to the user after the upload has been completed. Let me quickly state that I am uploading Individual Images to Separate Nodes (1 image, 1node, in album). I have a Node Reference, and I am presented with the option to display this after uploads on the Next Step.

Problem is, I am presented with all other fields, including Title, Description of Image, etc, but not the Node Reference field. This is very important as I am allowing users to upload images, and assign them to an Album by Node Reference. Could you look into this sometime? I am using the latest stable versions of everything.

I found this on a related thread: http://drupal.org/node/422700

So, if I understand, it should automatically create taxonomys for you. I now realised that you mean the image_fupload_image.module part.
The problem is that there are so many ways of sorting images (for example taxonomy, node reference, cck --> multiple images per node), so if I integrate this thing, another will be requested a few days later. I think, it would be better to provide the user a interface to create their gallerys separately or use hook_form_alter (only for programmers) to do it you like.

In so, I have a solution in the mean time. Create a view listing all Images created by a user that has no Album Reference, and with the Editable Fields module, create a Click to Edit field where the user can select Albums.

Regards,
Greg

CommentFileSizeAuthor
#23 image_fupload_patch.tgz220 KBszantog
#22 426394.patch8.79 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grandcat’s picture

Title: Node Reference & RC1 » CCK Fields in Preview list not displayed
Category: bug » feature
Status: Active » Postponed

I gave this issue a better title.
I know this "bug", it's a feature which is not implemented yet and I found actually no time to do it. But I think, this should, however, ready in the next days.

gdtechindia’s picture

nice point Greg.
I have noticed that GrandCat has worked a lot on this great module. I am sure, he will soon provide this option as well.

This module saves lot of time.

gdtechindia’s picture

any update on this
thanks

rokr’s picture

If the settings are set to "One image per node" it would be great to enable fields (like cck or taxonomy)
a) globally on node/add page to set a field for all new nodes (usefull for galleries with nodereference and similar fields)
b) at "Edit Captions" page, where users can fill additional infos on a per node basis.

cheers, Ronald

grandcat’s picture

These features are already possible to use (without CCK support on preview list page).

blup’s picture

I personally can't see any of the cck fields I checked off in the settings in the preview list/edit caption page. It only displays the image title, image description, and taxonomy... no cck fields at all.

grandcat’s picture

I know this "bug", it's a feature which is not implemented yet and I found actually no time to do it.

blup’s picture

Oh, my bad... i thought you meant that it was already implemented in post #5.

gdtechindia’s picture

is it showing you Taxonomy ?
I can't see it. I am really looking to see it there. That will solve the problem.

grandcat’s picture

Taxonomy works in the preview list. You have to enable it.

gdtechindia’s picture

Sorry to ask this again, but i didn't see the option.
On "Edit Captions" page, i see only two fields which i can edit
1. Title: *
2. Body:

I am not aware where i can enable Taxonomy Fields on EDIT CAPTIONS page.

Best Regards
Dhaliwal

grandcat’s picture

You have to go to CCK's imagefield settings where the widget "fupload" is active. There, you can set the fields which should show up on the edit page.

mckeen_greg’s picture

It works wonderfully, thank you again grandcat. :D

rjbrown99’s picture

I actually think Greg's solution with the view is a great one (see the last line of the original issue.)

Perhaps what could be done here is to create a 'default view' for the preview list that is created when the module is installed, and then this is the default post-preview for the core Image FUpload module. That would offer a lot more flexibility in terms of what fields are displayed, how they are displayed, etc. And all of that could be done without code modification.

If you don't want to force a dependency on editable fields, you could also keep what is there if that module doesn't exist. Perhaps make it an optional deal.

At any rate, thanks for the suggestion Greg - it's going to work out well for me.

rjbrown99’s picture

Another thing I did working with the view idea suggested by Greg -

I created a CCK field called 'title', with the thought that I wanted to display the title as an editable field in the same view without writing any more custom code. I then wanted that title saved back as the 'official' title of the node. To do that, I use the autonodetitle module. But that module only runs when the node is initially saved, and in this case the node is initially saved during the initial image_fupload action. To work around that, use the Rules module and this post:

http://drupal.org/node/360359#comment-1460918

I then created a rule action with a condition of "when the CCK field_title has been changed" and an action of "execute custom PHP code" to re-run autonodetitle. This solved it and now the title field is editable via CCK in my view.

gdtechindia’s picture

i tried many ways, but it doesn't work for me.
will try tonight with new install.

sdk’s picture

For me the regular Taxonomy works but not the CCK field (Content Taxonomy Field), though i can enable it in the imagefield settings. Should one choose a special content taxonomy type (autocomplete, multiple select, drop down etc.)?

Best Regards
sdk

rjbrown99’s picture

If you are continuing to try this by overriding the internal preview with your own view, here are a few things to consider -

1) Copy the swfupload-settings.tpl.php to your theme directory

2) Empty your theme cache so it picks it up

3) Inside the function UploadComplete, find the var redirect_url_main and change it as follows:

var redirect_url_main = "/path/to/my/view/page";

This will make the "Next Step" button head directly to your view and will bypass the internal preview.

grandcat’s picture

Thank you for the info with the module "editable fields".

I had a review at this one, it's working well, but the problem is, it will only work for "one image per node". So we can't remove the preview page completely.

rjbrown99’s picture

My use case is one image per node, but couldn't you create the view to display multiple images that are tied to the same node and then theme appropriately?

grandcat’s picture

The problem isn't Views, but the "editable fields" module.

jhodgdon’s picture

Version: 6.x-3.0-rc1 » 6.x-3.x-dev
Status: Postponed » Needs review
FileSize
8.79 KB

Back to the original issue report: the problem being that when you set up an Image FUpload field, it asks you whether you want to edit all the CCK fields and taxonomies on the Edit Captions screen, but then in practice only Taxonomy, node title, node body, and image attributes (alt, title, description) are displayed, and the other fields are missing from the original edit screen.

I took a look at this module, and the area where it form alters the node editing form had a comment in it like "CCK fields - coming soon in a later version". So I think this was an intended feature, but it hadn't been implemented yet.

I had a client that needed this feature today, so I went ahead and implemented it. In addition, they needed the ability to set up defaults for taxonomy and fields, so I added that too. The idea is that on the first node add screen where you upload the images, you can enter default values for taxonomy and the fields you will be editing on the Edit Captions screen. Then when you click "next step" and get to Edit Captions, you see the default values applied to each node, and then you can edit them, enter missing values, etc.

I was able to get both of these features working. Here's a patch that works on my client's site. This patch is against HEAD, which I think is the 3.x branch.

Notes:
a) This client doesn't have any multiple-valued CCK fields on the node type we are using, so I haven't tested it with mutiple-valued CCK fields. I've only tested it with single-valued text fields, text boxes, and checkboxes. It works fine for all of those cases.

b) This client doesn't have tag-based taxonomies on this node type, so I've only tested it with multiple-select non-tag taxonomies, and it works fine for that.

c) We are using the "multiple uploads creates multiple nodes" setting, so I've only tested it with that. I haven't tested with the "multiple uploads attaches all the images to a single node" setting.

szantog’s picture

FileSize
220 KB

Thanks, this patch works perfect, but the setup was the same, as you. I only can say this more: It works with field with wysiwyg editor.

A attach the patched tgz, if somebody want review it without own patching.

Dadaisme’s picture

I have the same setup 1 image, 1 node, in a galery. The patch did work for adding the cck node reference to the next step.

But my cck taxonomy did not show up and I did not see the feature "ability to set up defaults for taxonomy and fields" (I did see it in code). Is it supposed to include a default node reference for album/galeries too?

There could be a problem whit hierarchical select (http://drupal.org/node/505046). I did uninstall it but there is still something nebulous going on, this could easily be a problem on my side, I'll look into it.

Thx.

Dadaisme’s picture

After looking into the said nebulous things on my side, I would say that the patch works... whit warnings:

During the upload phase, 1 set of warnings for each image :
warning: Illegal offset type in isset or empty in /var/www/vhosts/fqechecs.qc.ca/httpdocs/cms/modules/taxonomy/taxonomy.module on line 1039.
warning: Illegal offset type in /var/www/vhosts/fqechecs.qc.ca/httpdocs/cms/modules/taxonomy/taxonomy.module on line 1040.
warning: Illegal offset type in /var/www/vhosts/fqechecs.qc.ca/httpdocs/cms/modules/taxonomy/taxonomy.module on line 1043

In the "Next step", 1 for each image :
warning: Invalid argument supplied for foreach() in /var/www/vhosts/fqechecs.qc.ca/httpdocs/cms/sites/all/modules/image_fupload/includes/images.previewlist.imagefield.inc on line 410.

Still using Hierarchical select.

Thx.

ohthehugemanatee’s picture

Worked for me - one image per node, user reference CCK field, on a content type with autocomplete taxonomy. I had to re-jigger the patch a little... not sure if that'sbecause I'm on a newer version, or because of the minor patches I made for php 5.3 compatibility.

One issue - using a multiple entry autocomplete, the "add another item" button gives errors:


warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/cck/includes/content.node_form.inc on line 314.
warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/sites/all/modules/cck/includes/content.node_form.inc on line 347.
warning: Wrong parameter count for max() in /var/www/sites/all/modules/cck/includes/content.node_form.inc on line 347.

I'll investigate in the next few days.

gstout’s picture

follow