I tried to display product images from commerce products. If Display "all" values starting from "0" is selected, all images display without problem. Trouble is, that i want to make a catalog grid view displaying only the first product image, where it would make sense that - Display "1" values starting from "0" - would work. It does not. I'm attaching the exported view.
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | content_duplicated_if_translated.png | 332.88 KB | Jerome F |
| #15 | multilingual_multiplevalues_views_2011-05-31_17_29.sql_.bz2_.zip | 202.47 KB | Jerome F |
| #15 | multilingual_multiplevalues_views.localhost.zip | 76.9 KB | Jerome F |
| kavci-view.txt | 7.33 KB | nicjasno |
Comments
Comment #1
bojanz commentedComment #2
dawehnerThis seems to be a duplicate of #1147054: Display "all" values starting from 1 still displays all values
Comment #3
bojanz commentedNo. The poster doesn't want to display "all". He wants one item, starting from the begining. That is all.
Comment #4
nicjasno commentedYeah. I did see that other issue, but since all items display without problem it is irrelevant to me.
Comment #6
Antoine Lafontaine commentedI confirm the same issue here.
Trying to display only one image from a specific node (using and argument) that has many images using one image field.
Comment #7
dawehnerThe problem on my installation was that the images was stored as 'und' but the current user language was 'en'.
Once this was done it worked fine.
Comment #8
Antoine Lafontaine commented@dereine
I think I understand what you mean, but I'm not sure what "this was done" relates to.
Do you mean setting the images to "english" or you mean setting the views to not care about language?
I'll try to investigate a bit more on my own, but I would be grateful - if you have the time - if you could explain what you did in a bit more detail.
Thanks.
Comment #9
Antoine Lafontaine commentedAs a reference for others who read this:
In your display go in the "Advanced" section under "Other > Query settings: Settings
Down the form there's a "Field Language" option. Set it to language neutral (or the proper language setting for your use case)
That fixed it for me.
@dereine
Thanks for hinting at the language problem!
Comment #10
nicjasno commentedVery interesting...
Comment #11
Jerome F commentedsubscribing, coming from http://drupal.org/node/1070744 which seems related
Comment #12
Jerome F commentedI tried to set to language neutral as advised in #9 and instead of :
Notice : Undefined index: en in views_handler_field_field->set_items() (line 676 in (...)/sites/all/modules/views/modules/field/views_handler_field_field.inc).
I now have :
Notice : Undefined index: und in views_handler_field_field->set_items() (line 676 in (...)/sites/all/modules/views/modules/field/views_handler_field_field.inc).
I tried to uncheck "When needed, add the field language condition to the query."
Comment #13
Jerome F commentedI had to set it to english - I wonder if this is because I created english content with image fields first and enabled the multilingual modules afterwards? This sounds like the problem dereine pointed out:
From IRC :
Jerome_F: in general you should FIRST define languages and then create content/fields etc.
I think the key is I created content/fields before I created languages - so I will try to drop my content and submit it again from scratch to see if it solves the problem.
Comment #14
Jerome F commented1) Create a test site with english as default language, don't enable multilingual modules yet
(It does make sense - use case: you work for a company which wants a website in its native language and then once they have the budget the translate it to open their website to foreign markets - you don't want to delete all content and submit it again once the translation process begins)
2) Modules :
suggestion: enable module filter module first for ease of use)
then enable: ctools + views + views UI + devel + devel generate
3) create a content type (A) with an image field (field_image_a) allow multiple values (illimited) I also tested a multiple values text field (field_multi_text) keep the Maximum lenght to a low value (15 characters for example)
4) create some content with devel generate
admin/config/development/generate/content
don't generate to much nodes about 10 is enough you will have to edit them. Just generate type A content.
5) create a view (admin/structure/views/add) with content of type A using fields, with a page display called B
6) edit the view:
add Content: Image (Appears in: node:a)
in Multiple field settings
check Display all values in the same row
Display 1 value(s)
add Content: Text multiple
with the same settings.
7) One value on each row version:
clone this page display name it C (override the title)
just override the settings for both fields: uncheck Display all values in the same row
and change the menu path to /c and the menu title to C
8) navigate to the 2 pages. If everything is all right with these views, the next step is to enable internationalization.
9) enable: Internationalization + Views translation
You're done the message displayed on view B is :
Notice: Undefined index: en in views_handler_field_field->set_items() (line 676 of /Users/jerome/Sites/acquia-drupal/sites/all/modules/views/modules/field/views_handler_field_field.inc).and there's nothing on view C
Comment #15
Jerome F commentedPlease find attached the test site database (from comment #14), just copy the provided folder in the /sites folder. and import the database to spare some time if you want. login: admin pwd: admin
You will need these modules :
Internationalization + Views translation + ctools + views + views UI + devel + devel generate
I use acquia drupal stack
Comment #16
Jerome F commentedAfterwards even if you configure internationalisation correctly, translate your nodes, change the languages, etc. you cannot get rid of this error.
If you delete all the content and generate new content in multiple language, the view C works ok, the view B displays only one image as needed, but the Notice is still displayed.
Comment #17
Jerome F commentedOn the english page, the view is displayed correctly.
I have tried to actually translate some content and complete the internationalisation setup. The result is that the translated content shows up twice on the same view on the foreign language page, once correctly, and once with all the multiple values (attached screenshot speaks for himself if this description is awkward)
Comment #18
Jerome F commentedmarked as duplicate of http://drupal.org/node/1070744
issue fixed