Comments

cboyden created an issue. See original summary.

dsnopek’s picture

StatusFileSize
new1.92 KB

Here's an updated patch that also changes the CSS to make it use the selected "Header orientation"

dsnopek’s picture

StatusFileSize
new1.92 KB

Actually, that one wasn't quite right. On some themes it would lead to "vertical" not highlighting the first column in the first row. This one is better.

cboyden’s picture

And here's a patch that adds two new tests for table header orientation.

dsnopek’s picture

dsnopek’s picture

Status: Needs review » Needs work

Hm. The patches fail testing on Travis :-(

cboyden’s picture

It looks like the first build is failing because panopoly_widgets is overridden. The second build gets past that, but it fails because the new field isn't available on the widget config form. Both might be fixed by an update hook. If we don't want to revert the whole field instance component, that would require some code in the update hook to just target the field instance setting that needs updated.

cboyden’s picture

Status: Needs work » Needs review
StatusFileSize
new2.97 KB

Here's an attempt to operate on the field settings without reverting the feature.

dsnopek’s picture

Hm. I'm not sure why this update hook is required when the tablefield patch does a very similar one:

+/**
+ * Move 'Header orientation' from formatter settings to default field value.
+ */
+function tablefield_update_7008() {
+  $instances = field_info_instances();
+  foreach ($instances as $entity_type => $entities) {
+    foreach ($entities as $bundle => $fields) {
+      foreach ($fields as $field_name => $instance) {
+        $field_info = field_info_field($field_name);
+        if ($instance['display']['default']['type'] == 'tablefield_default') {
+          if (isset($instance['display']['default']['settings']['header_orientation'])) {
+            // Copy 'Header orientation' from field formatter into the
+            // fields default value.
+            $instance['default_value'][0]['tablefield']['rebuild']['header_orientation'] = $instance['display']['default']['settings']['header_orientation'];
+            unset($instance['display']['default']['settings']['header_orientation']);
+            field_update_instance($instance);
+          }
+        }
+      }
+    }
+  }
+}

See https://www.drupal.org/files/issues/2020-04-22/tablefield-header-orienta...

Here's a new Travis build of this patch, though: https://travis-ci.org/github/panopoly/panopoly/builds/681217048

dsnopek’s picture

Here's a new patch that is just a drush fu panopoly_widgets after running the tablefield update. It removes the update hook from #8 because I'm hoping that's not actually necessary. Let's see how this does on Travis.

dsnopek’s picture

StatusFileSize
new2.34 KB

Gah, that was a profile patch but only of panopoly_widgets which is the worst of both worlds. :-) Here's just a patch for panopoly_widgets so the two patches will get merged when the tests run.

EDIT: Here's the travis build: https://travis-ci.org/github/panopoly/panopoly/builds/686265769

dsnopek’s picture

That patch also failed, but I think it's because the tests aren't running the individual .make files, but the overall profile one. So, here's a profile patch that includes both the panopoly_widgets and panopoly_test changes - let's see how this does!

EDIT: Here's a new Travis build: https://travis-ci.org/github/panopoly/panopoly/builds/686280497

dsnopek’s picture

StatusFileSize
new7.35 KB

That patch failed too. :-( It looks like there's nothing in Panopoly that's setting scope="row" on those row headers. That's probably a tablefield bug? Anyway, I've adjusted the tests here just so we can get what we have committed.

EDIT: Here's the Travis build: https://travis-ci.org/github/panopoly/panopoly/builds/686300049

  • dsnopek committed 54c2778 on 7.x-1.x authored by cboyden
    Issue #3130749 by dsnopek, cboyden: Patch Tablefield for header row...
dsnopek’s picture

Status: Needs review » Fixed

This finally passed! So, I just merged it. :-)

  • dsnopek committed 6b35bab on 7.x-1.x
    Issue #3137642 by dsnopek: Fix Features overridden after tablefield...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.