Closed (fixed)
Project:
Image
Version:
6.x-1.x-dev
Component:
image.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2009 at 13:38 UTC
Updated:
2 May 2009 at 01:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
mean0dspt commentedOk, so I've investigated all the places I could think of and found no UI to control the weight of the image. So I'm changing this to bug report from support request
Comment #2
sunNot really. This is a feature request. Patches are welcome.
Comment #3
sunMarked another request as duplicate of this issue - which was related to Image Attach though. This means, both modules should expose their fields to CCK properly.
Comment #4
mean0dspt commentedCKK? I hope for this option to work on regular install, without CKK
Comment #5
sunI do not think there is a way to change the order fields in a content-type without CCK. Since the core of CCK will be in Drupal 7, I am highly reluctant to add any overhead to Image module that is already covered by CCK - you can customize the output for image nodes in your theme.
Comment #6
sunComments referring to functions should use braces after the function name. The trailing dot is kept.
There should be a blank PHPDoc line between the summary and description. Let's strip "Lets CCK" in the description.
Array initialization is only needed for a) uninitialized, indexed arrays, ie.
$extra[](ie. no named or forced numeric array keys) and b) variables that need to be re-initialized. In this case, the initialization is not needed.With above ammendments removed, we don't need blank lines before and after the $extra array.
Comment #7
dman commentedJust IMO...
In the spirit of clear initializations, the pickyness of coder.module, and the sheer paranoia that E_NOTICE throws at us, I'd say that declaring an array before you use it is perfectly fine coding practice, and not something to be chastised for.
It's actually clearer code for maintainers, is at least as effective at highlighting minor code slip-ups as some other trivial complaints, and I actually would have expected E_NOTICE to justifiably complain about it. Well, as justifiably as it's other little moans are.
Comment #8
sun@dman: Are you on the philosophical side of life again? :) Drupal core no longer initializes keyed arrays, e.g. in hook_menu() and other locations, so this has become a nice new standard, which obviously requires to know when it is ok to omit the initialization, but for such cases, it removes needless cruft.
Comment #9
dman commentedOh yeah, it's not a sticking point at all, I was just interested in your opinion stated above.
Lots of other languages (and books) require or at least recommend declaring your vars. My take is that in PHP it doesn't hurt, saves scanning up to far to see what that array is all about, and is a useful place to drop in a comment.
Don't want to bikeshed it, but (IMO of course) it's not a bad thing to do.
But I always go for explicit code and don't worry too much about extra lines if it's clearer that way.
Comment #10
joachim commentedPatch for image module.
Lets you move the image field around with CCK.
Not that title, taxo, and menu fields are shown in CCK, but aren't controllable. You can move them, but it won't have any effect (there's a bug on CCK for this, though whether that's to lock them to prevent giving the illusion, or make them movable, I don't know.) So with this patch, you can move image in relation to body and any CCK fields you add.
Comment #11
sun@joachim: Seems like this is the old patch? Did you see the review for it in #6? Sorry, duplicate issue hell.
Comment #12
joachim commentedAh, sorry, didn't get what that was about as there's no earlier patch -- is it about my patch? Oh I see...
> Comments referring to functions should use braces after the function name. The trailing dot is kept.
Fair enough, but I copied that line from CCK.
> Array initialization
Ditto.
Comment #13
joachim commentednew patch with your suggested changes.
> Let's strip "Lets CCK" in the description.
I disagree. It should be clear that this is a hook for CCK, not core.
Comment #14
sunThis works pretty good, but we have one caveat: The image thumbnail and "Rebuild derivative images" checkbox is still output at the top of the node add/edit form. (see attached screenshot)
Comment #15
joachim commentedAs discussed on IRC, I've grouped the image-related fields together: thumbnail, upload field, regenerate checkbox.
They can be grouped with an anonymous array, but if we want to be able to style them too, easiest thing is to give them a fieldset.
Exposing this fieldset to CCK allows moving the whole of it in the CCK UI.
Comment #16
sunNice! Now it works as intended.
There's just one remaining thing that bugs me now: Usually we use fieldsets for multiple value fields only, but we will only ever allow the user to upload one image into an image node. I'm especially considering this regarding Image Assist, which, with this patch: #386298: Simplify the upload form, patch attached (screenshot), renders the absolute minimum of the image node form. So I wonder whether we shouldn't use #prefix and #suffix instead, as discussed in IRC.
But then again, I'm not 100% sure, so I defer this decision to you.
Comment #17
joachim commentedGiven that the image is an essential part of an image node, there's a case to be made for having it outside of fieldsets like the other essential element (title and body).
I prefer to avoid HTML in forms where possible, but #attributes don't work on markup types despite the docs saying so: http://drupal.org/node/424180 :(
So let's go with #prefix and #suffix.
Comment #18
sunFixed changelog entry, white-space on blank lines, one wrong indentation, and committed. Thanks!