Please see this thread I opened in core.

Quick summary: after performing the update from 7.x-2.0-alpha2 -> 7.x-2.0-alpha3, I lost all of my administrative titles for views fields, and the links would only go through to the first of those fields. For example, if I added two global custom text fields, and gave both a unique administrative title, neither administrative title would appear in the field list, and the link for both would go only to the settings for the first. This renders Views very difficult to work with on any site that uses multiple fields or administrative titles. See attached image.

After much thread pulling and some disaster, I stepped through a number of updates, and have narrowed it down to the Ember update. After digging through the Ember update, believe it may be caused by views-related code in the themes/ember/template.php file. For example, this code appears particularly suspicious to me:

  $type = 'field';
  foreach ($display->handler->get_option("{$type}s") as $id => $field) {
    $handler = $display->handler->get_handler($type, $id);
    $text = _ember_views_ui_field_link($field, $handler, $relationships, $type, $root_url);
    $build['details']['columns']['first']['fields']['fields'][$id]['#link'] = $text;
  }

and

function _ember_views_ui_field_link($field, $handler, array $relationships, $type, $root_url) {
  // Split out the title into its components.
  // @see views_handler_field::ui_name()
  // Add the new field descriptions to the output, replacing the default.
  $new_label = "<span class='views-field-entity-type'>{$handler->definition['group']}:</span>";
  $new_label .= "<span class='views-field-title'>{$handler->definition['title']}</span> ";

  if (!empty($field['relationship']) && !empty($relationships[$field['relationship']])) {
    $new_label .= "<span class='views-field-relationship'>{$relationships[$field['relationship']]}</span>";
  }

  // Reuse some code from the parent function to build up the link again.
  $description = filter_xss_admin($handler->admin_summary());
  $link_text = $new_label . (empty($description) ? '' : "<span class='views-field-label'>($description)</span>");

  $link_text = "<div class='views-field-description'>{$link_text}</div>";

  $link_attributes = array('class' => array('views-ajax-link'));
  if (!empty($field['exclude'])) {
    $link_attributes['class'][] = 'views-field-excluded';
  }

  return l($link_text,
    "$root_url/$type/{$handler->field}",
    array('attributes' => $link_attributes, 'html' => TRUE)
    );
}

I'm still working to get my dev site back online, but wanted to get this posted in the meantime in case anybody else is having the issue. Rolling ember back to 7.x-2.0-alpha2 seems to resolve the issue.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jweirather’s picture

Title: Lost fields' admin titles and edit links after upgrade to 7.x-2.0-alpha3 » Lost Views UI fields' admin titles and edit links after upgrade to 7.x-2.0-alpha3
Bcwald’s picture

Can you try the dev version? I believe this issue was resolved in a recent update:

Take a look at this issue: https://www.drupal.org/node/2458483

jweirather’s picture

Priority: Critical » Major
Status: Active » Needs review
Related issues: +#2458483: Views - generates a wrong link to edit the field

@Bcwald: thanks for the update, they definitely appear related.

I will try the dev version and post back with the results. It may be a few days (weeks) before I can work that into my queue. I'm still in DR mode on a couple of other issues.

Also updating status and adding related issue.

jweirather’s picture

As an aside, I did search extensively for a solution to this issue, I'm not sure how I missed this related issue. Sorry for the dup.

mike.vindicate’s picture

I can confirm this works with the following Drupal + module setup:

Drupal 7.37
Views 3.11
Ember 7.x-2.0-alpha3+3-dev

jweirather’s picture

After applying the dev version and clearing all caches (both through drush), the link itself is now properly mapped to the correct field, but the label is still not showing the administrative titles that I set under "More" in the field settings. I have also updated core to 7.37

This is a big issue for us as we have numerous "global: text" fields in some of our views, and with this version(s) of the theme we are unable to tell them apart.

For now I have to revert back to alpha 2. I'll be happy to test again if there are any updates, and to attempt a patch if time permits.

Edited to confirm versions:

Drupal 7.37
Views 3.11
Ember 7.x-2.0-alpha3 dev

(field link works, description does not)

Cameron Tod’s picture

Assigned: Unassigned » Cameron Tod
Cameron Tod’s picture

This should address the admin titles - it appears they are shown correctly during local testing.

Views

jweirather’s picture

The patch in #8 worked for me.

The field hrefs and the labels are both correct. Now that I'm current with the theme I can see all the other improvements as well, and it's coming along nicely.

FYI - the Ember experience is *so much better* than default. It's a game changer for many of the fence-sitting developers I show it to.

Thanks for all your efforts on this!

(I'm not sure if one user constitutes RTBC, so I'll leave that up to you)

jweirather’s picture

Scratch that -- there are new issues now. I'm working to narrow the scope, but we've observed the following behaviors:

While in views, adding fields:

1) adding a Global: Custom Text field WITHOUT an admin title. During the add process, while the field "modal" window is open, the field shows up in the Views UI fields list (behind the modal) as expected. Upon applying the settings from the modal, the field disappears from the UI list. If we look at the export, some/most of the field settings do seem to appear, but the field itself does not return to the list.

2) adding a Privatemsg: Send Privatemsg Link: The field settings modal does not load completely, stopping after replacement patterns. Nothing loads below that point, including the "More" section. If we apply and save, then try to export, the export data appears to be incomplete (as we might expect, based on the modal behavior)

We haven't gone much further than that in testing, and will have to roll back to previous (alpha 2) version for now.

Thanks!

Cameron Tod’s picture

Hi jweithrar - thanks for the detailed reports. It seems like you've got some really good use cases which flush out some of the edge conditions with our altering of the Views UI. Do you think you could post a patch? I think it may speed things up.

jweirather’s picture

@cam8001: I will try to, but I'm not even (yet) sure what exactly isn't working, etc. My coding skills are decent in some areas, not so much in others. I'll set aside some time see what I can do.

When you say "altering the Views UI", are you talking about just styling updates, or actually changing Views' behaviors?

My personal experience has been trying to modify underlying behaviors can be a bit of a "rabbit hole". If that's where the issues are, I'm not sure I'm the best guy for the job.

That said, I'll take a look and see what I can do.

Bcwald’s picture

any luck @jweirather? Id like to try to address this as I want to roll a new version but this seems important.

jweirather’s picture

@bcwald: Sorry, the daily grind has kept me from looking at this so far.

Also, as I alluded to before, I'm not sure I'm the best guy for the job if the issue is modifying Views' default behaviors. I'm definitely game to try, but it will have to come after a product launch I'm very much in the middle of right now.

As an aside, and IMHO, if it were me building the theme, I might add a toggle in the theme settings to switch on/off the Views UI overrides. I'm not sure everybody wants to change the UI (labels, links, etc) of Views as much as they want the cleaner, simple general styling upgrades offered by Ember. They seem to me to be two separate issues. Just my $0.02.

Thanks for checking in. I'll circle back to this as soon as time allows.

Bcwald’s picture

Yeah, I agree with the toggle switch, we have been doing that with everything in Ember Support

Cameron Tod’s picture

I'm at DC Barcelona and have some time aside for contribution. I'll work on this now.

Cameron Tod’s picture

OK, this should clear up the missing field issue for fields without admin titles, and I have implemented a toggle for the views UI overrides in the theme settings. I couldn't reproduce the privatemsg issue.

jweirather - could you test this latest patch to see if the privatemsg modal loads with it applied?

jweirather’s picture

1) Thank you. Especially for the UI overrides toggle. Much appreciated.

2) I'm in the middle of a rather consuming site launch (and code freeze). I should be able to look at this early next week. Tuesday ish.

I'll do my best to get to it before then, but things are a bit hectic right now.

sylus’s picture

Status: Needs review » Reviewed & tested by the community

I just took a look at this patch and it fixed some longstanding problems I never noticed this was the cause related to multiple custom text fields. Thanks so much for the work. The patch worked great but especially appreciated the toggle override.

Thanks alot @cam8001

sylus’s picture

Should have mentioned I also need this patch on top of alpha3.

Cameron Tod’s picture

Just a slight tweak to ensure that you could have '0' as a field title if you wanted.

  • Bcwald committed 8641ce3 on 7.x-2.x authored by cam8001
    Issue #2469143 by cam8001: Lost Views UI fields' admin titles and edit...
Bcwald’s picture

Status: Reviewed & tested by the community » Closed (fixed)
jweirather’s picture

I just downloaded and installed 7.x alpha 4, and all the issues I've mentioned appear to have been resolved, and the toggle is there, which is GREAT for us. We're going to keep the overrides enabled for now, but I feel much better knowing I can revert to default using a simple checkbox.

Thanks everybody for pitching in, much appreciated.