When a relationship is added to the view (for instance "File Usage: File"), the Editable Views functionality no longer works on random table rows.

Tested it with other relationship options and still had the same result.

Please see attached images.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

I've not tested it with the File Usage relationship. It works fine for me with entityreference relationships pointing to nodes.

Is your relationship required? If not, might it be resulting in partially empty rows?

Can you do some debugging to see where the problem is?

aseabrook’s picture

The view is of type Users. It seems to be happening with the following relationships:

  • User: Content authored
  • User revision: Revision author (User Revision module)
  • User revision: User (revision ID) (User Revision module)
  • User revision: User (uid) (User Revision module)

In the frontend, on the rows that the editable field isn't functioning, the follow code parses:

<div class="views-row-edit-edit"></div>

On the rows that are functioning properly:

<div class="views-row-edit-edit">
  <div id="edit-user-11-field-status" class="field-type-text field-name-field-status field-widget-select-or-other form-wrapper">
    <div class="form-item form-item-user-11-field-status-und">
      <div class="select-or-other select-or-other-processed">
        <div class="form-item form-type-select form-item-user-11-field-status-und-select">
          <select size="0" name="user[11][field_status][und][select]" id="edit-user-11-field-status-und-select" class="select-or-other-select form-select">
            <option value="_none">- select -</option>
            <option selected="selected" value="In">In</option>
            <option value="Gym">Gym</option>
            <option value="Lunch">Lunch</option>
            <option value="Out">Out</option>
            <option value="select_or_other">Other</option>
          </select>
        </div>
        <div class="form-item form-type-textfield form-item-user-11-field-status-und-other" style="display: none;">
          <input type="text" maxlength="40" size="60" value="" name="user[11][field_status][und][other]" id="edit-user-11-field-status-und-other" class="select-or-other-other form-text">
        </div>
      </div>
    </div>
  </div>
</div>

I thought that the issue could be with the Select (or other) module but when I tested it with a standard list field I still encountered the same issue.

I think the culprit may either be the User Revision relationships or user relationships in general.

joachim’s picture

Is your relationship producing empty rows as part of its normal operation?

aseabrook’s picture

Negative. That large code chunk that I inserted in my previous post (the editable field) is what normally appears on all rows. The moment I add a user relationship, the editable field disappears on certain rows.

What's strange is that the disappearance pattern is different depending on the type of user relationship (e.g. User: Content authored; User revision: Revision author (User Revision module); User revision: User (revision ID) (User Revision module); User revision: User (uid) (User Revision module)).

joachim’s picture

Can you reproduce this on a view that uses only core components, and export it please?

joachim’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

> User: Content authored

That produces multiple rows per user, doesn't it?

In which case, this behaviour is completely normal: you only get one form element for each entity's field. The editable field does not get repeated, unlike regular fields.

BrightBold’s picture

@aseabrook — Yes you have something in your view relationships that is creating duplicate rows. I was having the same problem and it turned out I had a taxonomy term relationship where I had failed to check the vocabulary I intended. So instead of there being a 1:1 entity:term relationship, there was a 1:many, and I was getting a new views row for each term present. (This was true even though I had set the query settings to Pure Distinct.) When I fixed the taxonomy relationship so only one vocabulary was used, all my phantom rows disappeared.