The TableField module has had a bunch of updates since Panopoly last updated it, including a new 3.x branch. The 3.x branch changes the back-end storage and includes hooks to manage the updates. This might be too much for Panopoly to take on right now, but we should at least update to release 2.5. The 2.5 update adds some accessibility and CSS fixes - including the ability to add a table caption.
[EDIT]: see comments #6 and #7, after successful preliminary testing it looks like updating to tablefield-7.x-3.1 is a reasonable proposition.
Comment | File | Size | Author |
---|---|---|---|
#24 | interdiff-2919401-24.txt | 807 bytes | dsnopek |
#24 | panopoly_widgets-update-tablefield-2919401-24.patch | 4.68 KB | dsnopek |
#17 | panopoly_test-update-tablefield-7.x-3.1-2919401-17.patch | 2.82 KB | cboyden |
Comments
Comment #2
cboyden CreditAttribution: cboyden commentedPatch is attached.
Comment #3
cboyden CreditAttribution: cboyden commentedThe 2.5 version of Tablefield provides a new bit of configuration - the ability to hide headers. This is causing a PHP notice on the add widget screen. See #2796515: Undefined index: hide_headers in tablefield_field_widget_form() for a description of the error message. Just going to the field settings page and saving fixes the error, but it can also be fixed programmatically by updating the field base config.
The updated module also provides two config settings on the field formatter: trim_trailing_cols and trim_trailing_rows. In the current Panopoly version, table rows and columns that are completely empty are still rendered in the output. Leaving these config settings at "false" replicates the current behavior. It would be better to turn them on, as it will rationalize the tables a bit more and avoid the visual and accessibility issues that can be caused by empty rows/columns. So this patch updates those settings to turn on trimming. But if that's going too far we could rip that part out.
Comment #4
dsnopekHere's a Travis build of the latest patch:
https://travis-ci.org/panopoly/panopoly/builds/323068629
Comment #5
byronveale CreditAttribution: byronveale at Princeton University commentedMorbid (okay, not really) curiosity, and the red "Not supported!" message in the module updates list leads me to create this patch…
(Hiding so as not to confuse the issue, but wanted to be able to test this patch.)
Comment #6
byronveale CreditAttribution: byronveale at Princeton University commentedFWIW, saw this on TableField's project page:
So 7.x-3.1 is working with rudimentary testing so far. If someone can point me in the direction of more targeted testing I could be doing, I'll be more than happy to do so…
Comment #7
byronveale CreditAttribution: byronveale at Princeton University commentedI have successfully tested TableField 7.x-3.1 for both new and existing sites, so making the leap and "suggesting" we go all the way with this update. Changing title of this issue from "2.5 at least", un-hiding the latest patch.
Comment #8
cboyden CreditAttribution: cboyden commentedThe updates to tablefield involve adding permissions and moving configuration from field base to field instance, and from field settings to display settings. So the feature is going to be overridden and not fully configured unless panopoly_widgets also updates its own configuration. I've attached a patch that accounts for this, and also added an accessibility patch.
Comment #9
cboyden CreditAttribution: cboyden commentedComment #10
byronveale CreditAttribution: byronveale at Princeton University commentedSuper, thanks cboyden, will test…
Comment #11
byronveale CreditAttribution: byronveale at Princeton University commentedMissing "=" in line #134; updated patch attached…
Comment #12
bkosborneWe've had the latest patch in production for a few weeks w/o issue.
Comment #13
dsnopekI haven't tested this yet, but here some quick patch review:
This grants a new permission in the update hook, but will the permission get granted to the right roles on a fresh install? This patch doesn't appear to change the permissions in the feature
I'm not sure this is a good idea. This'll revert any customizations to any field that came from panopoly_widgets.
Is maybe tablefield_update_7006() enough to convert the settings so that they match the feature? If not, some more targeted updates would be better.
Here's a new Travis build of the current patch:
https://travis-ci.org/panopoly/panopoly/builds/353063921
Comment #14
cboyden CreditAttribution: cboyden commentedThe new permission is granted on install. (This feature doesn't include any permissions anyway.)
I've attached a new patch that removes the field reverts. The tablefield update seems to be enough to get the feature into its default state.
Comment #15
cboyden CreditAttribution: cboyden commentedSorry, wrong patch in the previous comment!
Comment #16
cboyden CreditAttribution: cboyden commentedAfter more testing, there are overrides in panopoly_widgets after updating tablefield:
The features export from Panopoly doesn't match the results of how Tablefield is updating its settings. And there are some missing. We'll need a targeted update hook to change the field's display settings.
Also, the table widget test needs updating.
Comment #17
cboyden CreditAttribution: cboyden commentedHere's an updated patch that changes the field settings individually, and a patch to panopoly_test to update the table widget scenarios.
Comment #18
dsnopekWhere is that granted on install? I don't see a
tablefield_install()
.This feature does have permissions! See panopoly_widgets.features.defaultconfig.inc
I'm actually a little confused about the update hook: it's looking for all roles with the 'configure tablefield' permission, and then giving the new permission to those roles - but we aren't explicitly granting 'configure tablefield' in Panopoly. Maybe this doesn't need to be done upstream in Panopoly?
Comment #19
dsnopekHere's a new Travis build:
https://travis-ci.org/panopoly/panopoly/builds/353475377
Comment #20
cboyden CreditAttribution: cboyden commentedThe permissions are available to the administrator role on install. Not sure where they're coming from, but when I do a fresh install of Panopoly, there are three Tablefield permissions (four, after this patch) and they're all granted to administrators.
Comment #21
dsnopekAh, that could just be the fact that the admin role gets all permissions? That should happen even without needing to specifically grant them in an update hook too. So maybe that bit can be removed?
Comment #22
cboyden CreditAttribution: cboyden commentedIf the explicit grant isn't included in the update hook, the permission is not granted to the admin role. This will result in different permissions between a clean install of the new code and an updated site.
Comment #23
dsnopekOk, I can confirm this in my own testing, but I think the fix is wrong. The only reason this permission is granted at all, is because all permissions get granted to the admin role. The current patch is giving the permission to every role with another permission, which could be a different list than just the admin role.
The reason we need to do something at all, is due to a core bug that new permissions aren't granted to the admin role when a code update to module adds new permissions, only when a new module is installed. So, I think the correct fix, is just to trigger the code that runs on module install in our update hook.
I'll post a patch that does this in a bit.
Comment #24
dsnopekHere's a new patch with the update hook changes. Otherwise everything seems fine and works in my limited manual testing. I'll commit it in a moment!
Comment #26
dsnopekCommitted!