Needs review
Project:
Image FUpload
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
27 Apr 2010 at 09:14 UTC
Updated:
25 Oct 2010 at 12:59 UTC
Jump to comment: Most recent file
Comments
Comment #1
grandcat commentedYou forgot to attach the patchfile ;)
Comment #2
Mesdag commentedOops forgot to click the 'Attach button'. Here it is.
Comment #3
grandcat commentedThanks, we'll check it.
Comment #4
a_lawry commentedHi,
I've tried this patch. It works great for the admin user. The cck fields aren't showing up for my other roles which have permissions to edit content. Which permissions does the user need for the CCK fields to show up on this page? I have the content_permissions module enabled and have granted all permissions to the user.
The image can be uploaded and taxonomy fields show up to be edited just not CCK fields.
Thanks.
Comment #5
a_lawry commentedDisabling content_permissions made the fields show up.
Comment #6
Mesdag commentedI found the issue, content_field_form returns form elements that are checked with content permissions.
Because we put in a new field_name (field_x_), it cannot make a match against the field name as seen in permissions (field_x) and returns false, disabling the field.
Renaming the form field will cause overwritten fields after submit.
Renaming the form field after it is generated might be a temporary solution.
-or-
Create each form as fieldset with #tree, this should allow us to keep all field names as is, and looping over every image node becomes a lot easier. This means a major refactor of the images.previewlist.imagefield.inc
How this is going to work with validation I'm not 100% sure.
Ideas and suggestions are always welcome.
Comment #7
Mesdag commentedA bit late response but here is a patch that makes the fields appear according to access.
It pretty much restructures the form to use #tree.
While I was at it, I added a couple of codestyle fixes.
Comment #8
EndEd commentedThe #7 patch is great :) Thanks
But in my case I use Conditional Fields a lot. I can let the user decide between a forced Select list of terms or a freetag if the Select list dont have a representative term of the image uploaded. This way the freetags can be revised by admins before put them on the forced list for others users.
This patch exposes the radio buttons that the Conditional Fields module use to let you choose between the select list or the freetags but it also expose the forced select list and the freetag Autocomplete widget. So it broken the Conditional Fields module behavior. Do you think it will be dificult to give support to this module in your patch?
Comment #9
adam_c commentedFrom the patch in #7, Im getting the error:
Fatal error: Unsupported operand types in C:\...\sites\all\modules\image_fupload\includes\images.previewlist.imagefield.inc on line 197
which is line:
$form[$image->fid] += (array) content_field_form($form, $form_state, $field);
Any idea what this is about?
Comment #10
Orjan commentedOne of the fields to be filled in in my version has a default value taken as a Node Reference from URL, but with this module, it's set to nothing, so I still need to select the correct Node Reference for each uploaded image.
Is this something that is changeable on this module that can keep the default value picked from url?
Comment #11
dboeije commentedI've applied this patch, but it blanks out whenever you submit your captions by clicking 'done editing'.
However: it does upload the picture and attaches it to a node, but still one of my CCK-fields has to be filled in manually.
Comment #12
gstout commentedFirst of all let me say thank you for this patch and "Please lets get this into the dev branch"
I found a bug in this code and solved it. This will be my first code contribution to Drupal so it's a little exciting to me. I'd make a legitimate patch if I thought I could pull it off.
I received this error
"Fatal error: Cannot use string offset as an array in C:\sites\slidesite\sites\all\modules\contrib\image_fupload\includes\images.previewlist.imagefield.inc on line 359"
Turns out the $value is a string so I added the int type cast ($value = (int)$value;) and all started working.
Comment #13
grandcat commentedPerhaps you could provide a new patch linked to DEV branch?
Comment #14
gstout commentedI really wouldn't know how. If I did I would