I have a field-collection with multiple html-button-fields. This field-collection is configured to contain an unlimited number of values.
I found several problems:

  1. When the buttons are set to be hidden on edit forms the columns containing them are not hidden and therefore the headers are still visible.
  2. Clicking a button on a node or view only works sometimes. I could not yet find a pattern when it's working and when not.
    When it is: When the button I clicked is shown within a view I have to reload the page to see the changes even though according to the log the page reload rule I set has been fired.
    When it is not:
    1. It seems the event is not even run. No entry in the log, no waiting animation below the button and of course no rule gets fired.
    2. The page still gets reloaded, but after that all button labels change to the one I just clicked (see attached wrong-buttons.jpg after clicking one of the "Bestellt"-buttons). When I reload the page the correct labels get restored (see correct-buttons.jpg).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

clemens.tolboom’s picture

Issue summary: View changes
MihaiMiculescu’s picture

Similar issue: A field collection with only one button field included, called "Variant button", but with unlimited number of values for the collection. Makes no difference mine is an image button.
Hint: Using Chrome inspector I discovered that ALL buttons have the same id!
This is what I get with "Inspect element" in Chrome, no matter which button I right-click->"Inspect element":

input class="button_field form-submit"
type="image"
id="view-field-variant-button-und-0-value"
name="view-field-variant-button-und-0-value"
value="Variant button"
src="url to the image"

Except for the FIRST one, which reads:

input class="button_field form-submit ajax-processed"
type="image"
id="view-field-variant-button-und-0-value"
name="view-field-variant-button-und-0-value"
value="Variant button"
src="url to the image"

MihaiMiculescu’s picture

After digging a bit more, I realized that, in this version, button_field is perhaps unsuitable for being part of field collections.
It has been designed to have a built-in cardinality of 1.
(See the .module file at line 271)
Therefore, when part of a field collection with multiple values, only the first instance of the button_field gets the royal ajax-processed favor.
Also the mechanism that builds the id needs perhaps a review.
Or am I on the wrong track?

clemens.tolboom’s picture

@MihaiMiculescu sound reasonable. Make sure to check the rules integration too to decide what button was pressed

MihaiMiculescu’s picture

@clemens.tolboom that would be a bit difficult, since ALL instances of the same button have the same ID!!
One can have, say, 3 buttons in a field collection item, such is the case in the picture above. Each with its ID. But in the subsequent lines, each button has the SAME ID as the corresponding button above!
This is where the core of the compatibility issue lies, IMHO.