1

I have 2 content types with image field. Shop and product.

For shop i limited number of images to 1, on products to 10.

Somehow the number changes to 10 for shop and to 1 for products (sometimes product doesnt change at same time for shop but in the end it happens). I noticed that it happens when i clear cache and run cron. I change values back to 10 and 1, and it works ok till the next cron run (or cache clear).

Any idea why is this happening ? All other content types (about 20) are ok, no changes for image fields.

1 Answer 1

2

If you're using the same image field on two content types then the cardinality (number of values) will be the same across both.

You'll notice you have 'instance' settings and 'field' settings on the field edit form. The 'instance' settings are unique to that instance, and can be different for each entity type/bundle the field is attached to.

The 'field' settings are global to that field, and the cardinality is one of these global field settings. If you change it for one content type, it will automatically change for the other content type. The caveat to this is that if you have data in the database for those fields already, you might not be able to change the cardinality at all (the select list will be greyed out).

This is by design, and how the field system works (there's no way around it). If you need to have two fields on two different content types with different cardinalities, you need to create two separate fields.

2
  • Thanks for the answer, i just saw it happen when i was saving fields a min ago, but i tought it was an error. When you say instance and field settings what exacly you mean ? I understand now that the number of values is same for all nodes using same field, but which one are unique per field?
    – Azz Kawa
    Commented Jun 29, 2012 at 15:31
  • 2
    You'll have two fieldsets on the settings page for the field...one entitled, e.g. "BASIC PAGE SETTINGS" (if the content type in question is 'page'), and down the bottom a second fieldset entitled, e.g. "BODY FIELD SETTINGS". The top fieldset contains the instance settings, and the bottom fieldset contains the 'global' settings for that field
    – Clive
    Commented Jun 29, 2012 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.