Closed (fixed)
Project:
Image
Version:
6.x-1.x-dev
Component:
views support
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
5 May 2009 at 15:32 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunSorry, I'm not really sure what you mean here. Could you please elaborate a bit more?
Comment #2
Ibn al-Hazardous commentedI have a view that displays image nodes as fields. I take "Image: Image preset size" as an argument, and I would like to use it when displaying the image field. When I add "Image: Image" to my set of fields, I get a number of settings - almost all of which look like in the previous dev-version. But the last one is a drop-down box that says "Image size to show", and this is a new one. Since it's there, I can't use the size set by the argument - I always get the size from the field settings.
I suppose that the expected behaviour would be for the "Image size to show"-option to disappear if I have size as an argument, or at least to have an option that says "Use argument size". In the previous dev-version, this just worked - no list of sizes, and the view used the size I specified as an argument.
My current workaround is to have a separate view for each size (4 of them), which works but isn't much fun to admin.
Comment #3
joachim commentedI'll look into this.
This isn't a use case we had considered and I can see its uses.
I'm all in favour of making one view work in several places -- I do that a lot :)
The thing is though the old argument would have been a filter. This is going to be merely a setting. So it's a sort of dummy argument that has to pass its value to the field. Not sure how we'll do that... suggestions welcome!
You could have 4 different displays as a workaround in the meantime. You'd only need to duplicate the fields, rather than have 4 views.
Comment #4
Ibn al-Hazardous commentedI'll see if I come up with something, but I'm not at all familiar with the programming API for views. I do know, however that the size argument can be passed to another field (named "Image size") - but it just writes the name for the text.
I tried using different displays first, but I call the view with views_embed_view - and it didn't take display names other than the standard ones as arguments. I may look into it a bit more - but I had to deliver something that works the day before yesterday. :/
Comment #5
joachim commentedOff the top of my head:
The image field handler could have a size option "take from argument".
The handler then needs to look in the $view object it has, look in the arguments, and find the argument we need. It then picks the value from that argument.
The argument handler meanwhile doesn't need to do anything except sit there, though if empty it should probably supply '_original'.
There should be a validation warning too, if the size option is set to argument but the argument isn't there.
If you fancy taking a stab at it, that would be great.
I'm coming up to a deadline so don't know when I'll be able to look at it.
Comment #6
sunHow about:
- Use the preset size select list to define the default.
- If the view doesn't use the preset size argument, use the selected size.
- If an argument is passed and it's a valid preset size, use that size.
- If no argument or an argument with invalid preset size is passed, use the selected size.
- Profit?
Comment #7
jesss commentedSubscribing.
From a user perspective, I think joachim's workflow is a bit more consistent with how arguments work elsewhere. Since you can set a default preset as part of the argument handling dialogue, all the decision making would happen in one place.
Comment #8
joachim commentedPatch on HEAD.
Please test :)
Note that #544098: Handler validation: validate defaulted handlers too means validation will not always manage to detect if the argument and the field are both present in a display.
Comment #9
sunuhm, why not simply remove this line?
Description seems to be cut off.
Prior to the description, there should be a one-line summary - not sure about the overall current state of the Views integration files.
Can we use proper PHPDoc syntax here?
Beer-o-mania starts in 22 days! Don't drink and patch.
Comment #10
joachim commented> //'module' => 'views', // This just tells our themes are elsewhere.
TBH I just commented out out of curiosity for what it might do. It's used in views but it's probably a re-basing thing for inc files that supply things for core modules. I've left in the uncommented line to avoid patch noise :)
Comment #11
joachim commentedThis patch is essential to a 1.0 release of image module.
I intend to commit it while at DrupalCon Paris, regardless of its status, prior to making a 1.0 release
If you care about the quality of image module, please try to test it before then.
Comment #12
sun@joachim: You can use a nice issue tag for that so we get a neat overview of issues to tackle for 1.0 (in addition to the manually compiled list in the release coordination issue). :)
Comment #13
joachim commentedNobody testing... :(
Ran it through its paces again. All works for me.
Committed.
Comment #14
Hetta commentedSorry about the "not testing". I tried to upgrade localhost from d5 to d6 and ran into a host of problems, although I was using a copy in a subdirectory ... something funky in my apache install. Gotta start that from scratch, and _that_ takes time.
Now, d5 I can test ... however, you're not doing patches against d5 anymore, so shrug.
Comment #15
joachim commentedI didn't mean anyone personally :)
Just that with however many thousands of users we have and hundreds of people commenting on issues, we have very few testers! :(
If there are tested patches for 5, I can commit them :)