Support from Acquia helps fund testing for Drupal Acquia logo

Comments

whastings’s picture

Status: Active » Needs review
FileSize
2.36 KB

Here's the patch!

whastings’s picture

I found that #1986056: Configuration modal shows wrong stuff for views content pane based on files also addresses this issue and has a patch, though it appears to be specific to file view modes.

Andrew Edwards’s picture

I marked #1986056: Configuration modal shows wrong stuff for views content pane based on files as a duplicate as the patch here has better code + is more generic.
It doesn't seem to apply against the latest dev though + needs some of the work from the other issue.
Working on it now.

Andrew Edwards’s picture

Status: Needs review » Needs work
FileSize
0 bytes

Hmn. It's getting there. I've merged the two issues + have tidied things up a little.
At the moment all is working well I think up until the final bit: rendered entities are not being displayed once the modal is closed.

However, the preview is working now for node, file and user entities. I haven't tested other entity types.
I've clearly broken something though as node entities used to save fine with a view mode selected.

Andrew Edwards’s picture

FileSize
5.25 KB
Andrew Edwards’s picture

Status: Needs work » Needs review
FileSize
5.52 KB

OK. This one works for me.
The problem with entities not rendering after saving is fixed I think.

Andrew Edwards’s picture

Improved default view mode (sometimes no default was set).
If teaser is available it is set as the default, if not available then the first view mode returned is set as the default.

Andrew Edwards’s picture

Component: Code » Admin
FileSize
5.74 KB

Updated patch for 7.x-1.6+2-dev
Also added code to check for old views that have something other than 'fields' or 'table' in settings.
If not 'fields' or 'table' then 'rendered_entity' is used. This is instead of 'nodes' for example.
I didn't just check for nodes as I have a legacy patch which added 'files'.

Andrew Edwards’s picture

Version: 7.x-1.0-rc5 » 7.x-1.5
Andrew Edwards’s picture

Version: 7.x-1.5 » 7.x-1.x-dev
Component: Admin » Magic
Andrew Edwards’s picture

Here's a new patch. Includes:

- fix to make sure preview defaults to teaser if no view mode is available (otherwise the first time a user views the form with a preview no view mode will be selected and the display will be a bit screwed)
- made this issue dependant on #2274023: Remove trailing whitespace from panopoly_magic.module as it was difficult to patch panopoly_magic.module with trailing whitespace

Andrew Edwards’s picture

Adjusted to include view_settings for preview
Still dependant on #2274023: Remove trailing whitespace from panopoly_magic.module

Andrew Edwards’s picture

Adjusted to make sure legacy way of storing entity type is changed within panopoly_magic_views_pre_view()

dsnopek’s picture

Here is a version of this patch that doesn't depend on #2274023: Remove trailing whitespace from panopoly_magic.module. As explained there, we can't commit coding style changes (including whitespace) until after we've gotten the number of unreviewed patches down. I'll review this patch in a moment!

dsnopek’s picture

Ok! I tested and reviewed and made a couple of changes:

  • Restored to the original default of "Fields" (rather than "Content")
  • Made what the helper functions do a lot clearer
  • Minor code-style fixes for the newly added code

I've attached an updated patch and interdiff from the last patch. I ran the tests I thought would be affected locally and they succeeded! I'm going to commit in a moment so that the full test suite will run on Travis-CI.

Thanks so much to @whastings and @Andrew Edwards for your hard work on this patch!

  • dsnopek committed 9478c39 on 7.x-1.x
    Update Panopoly Magic for #2144021 by Andrew Edwards, dsnopek, whastings...
dsnopek’s picture

Status: Needs review » Fixed

Committed!

Let's see what Travis-CI has to say:
https://travis-ci.org/panopoly/panopoly/builds/29063701

Status: Fixed » Closed (fixed)

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

Andrew Edwards’s picture

Woohoo! Thanks @dsnopek