It would be really great if we could panelize the file/%file pages. This is different from #1314876: Provide some ctools content type plugins for working with files in that Panelizer integration is different.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Dave Reid’s picture

Status: Active » Needs work

I've pushed what I have so far to a new Git feature branch: http://drupalcode.org/project/file_entity.git/shortlog/refs/heads/156445...

Dave Reid’s picture

Issue tags: +sprint, +Media Initiative

Adding sprint tags.

Dave Reid’s picture

So right now, if I go to admin/structure/pages and enable the file/%file page and then click 'Edit', this is what I see and I believe that I should be seeing a 'File panelizer' under 'Variants'

stevector’s picture

There's a module that provides a task plugin to replace other task plugins: Page manager existing pages.

I'm not sure of Earl's opinion as to whether contrib modules should still provide their own task plugins or use something like this instead.

Dave Reid’s picture

The view point I'm looking at here is that the majority of file_entity is targeted to move to D8 core. At that time we'll have to move the support for Panels (or whatever we're using in core at that point) to the contrib module out of file_entity, which is consistent with what Panels and Panelizer already do. How does Page manager existing pages change that assumption? I'm confused now on what's the responsibility between the two modules with regards to supporting core entities?

Dave Reid’s picture

So one thing I'm blocked on is #1566112: ctools_entity_field_extra_content_type always assumes extra fields are only available from hooks. I've also filed a couple of unrelated PHP notices in CTools and Panelizer.

Dave Reid’s picture

Once I added just a normal Panel variant to file/%file, I was able to add file content except for the File > File extra field which I commented on in #7.

Dave Reid’s picture

Title: Provide support for Panelizer » Provide support for Page manager, Panels, and Panelizer
Dave Reid’s picture

I need to make sure to include some credit to EclipseGc for the initial patch at #1058098: Add ctools page_manager support for file/%file path

logaritmisk’s picture

Merged branch 1564456-panels-panelizer with 7.x-2.x and created a patch.

Devin Carlson’s picture

Status: Needs work » Needs review
Lukas von Blarer’s picture

After applying this patch, I am getting this error:

Fatal error: Declaration of PanelizerEntityFile::get_default_display() must be compatible with that of PanelizerEntityInterface::get_default_display() in /sites/all/modules/file_entity/plugins/entity/PanelizerEntityFile.class.php on line 123

After downgrading Panelizer from 7.x-3.x to 7.x-2.x, it worked. I will try to look into this. Any help is appreciated.

Lukas von Blarer’s picture

Status: Needs review » Needs work
FileSize
11.71 KB

I fixed the error. But Panelizer does not override the normal display mode. What could be missing to do that?

And when using the file template I get this error:

Fatal error: Call to undefined function file_entity_view_page() in /sites/all/modules/file_entity/plugins/tasks/file_view.inc on line 108

Lukas von Blarer’s picture

I am sorry, the Panelizer functionality does work. But i am not able to actually display the file. When using "File" pane nothing is being displayed. Basically I would like to get the output according to the settings at "Manage file display".

@Dave Reid can you tell me how to do this and I will create a ctools content type plugin for it.

gmclelland’s picture

@Lukas von Blarer - I haven't tried this, but did you happen to add a file entity context first? See #1314876: Provide some ctools content type plugins for working with files

Lukas von Blarer’s picture

Status: Needs work » Needs review
FileSize
11.84 KB

@gmclelland you are a life safer. Thank you!

I fixed the error in the patch I encountered on the file template as well. What do you think of it?

aaron’s picture

Issue tags: -sprint, -Media Initiative

#17: 1564456-panels-panelizer-17.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1564456-panels-panelizer-17.patch, failed testing.

SocialNicheGuru’s picture

patch no longer applies to the newest ctools

DamienMcKenna’s picture

In case it isn't obvious, please only work on patches to integrate with Panelizer v3, v2 is deprecated and will be marked as "unsupported" RSN: #2151825: META: Drop support for v2?

SocialNicheGuru’s picture

Issue summary: View changes
Issue tags: +panelizer, +file_entity

I have gone to admin/structure/pages
I enabled /file/%file
I enable panelizer for file: admin/config/content/panelizer
drush cc
drush rr --fire-bazooka
I now goto /file/add and I am able to add a file ok
I goto node/add and click on my-media content type
I have added field_mymedia of type media
I upload the picture and I get a major error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'file-132-0-page_manager' for key 'PRIMARY': INSERT INTO {panelizer_entity} (entity_type, entity_id, revision_id, name, no_blocks, css_id, css, pipeline, contexts, relationships, did, view_mode, css_class, title_element, link_to_entity, extra) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15); Array ( [:db_insert_placeholder_0] => file [:db_insert_placeholder_1] => 132 [:db_insert_placeholder_2] => 0 [:db_insert_placeholder_3] => file:image:default [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => standard [:db_insert_placeholder_8] => a:0:{} [:db_insert_placeholder_9] => a:0:{} [:db_insert_placeholder_10] => 0 [:db_insert_placeholder_11] => page_manager [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => H2 [:db_insert_placeholder_14] => 1 [:db_insert_placeholder_15] => a:0:{} ) in drupal_write_record() (line 7219 of /var/aegir/platforms/7/servers/sng-contrib/sng-d7.26-oa-dev/includes/common.inc).

DamienMcKenna’s picture

@SocialNicheGuru: That was a bug in Panelizer (#2227637: Duplicate entry 'user-1-0-page_manager' for key 'PRIMARY': INSERT INTO {panelizer_entity} ), which was fixed a few days ago. You might try again with a fresh copy of -dev.

krisahil’s picture

I re-rolled and tested the patch from #14 against latest panelizer 7.x-3.x and file_entity 7.x-2.x.
The Panels and Page Manager integration works well. However, there is still work to do on Panelizer integration (Need Panelizer tab to display when editing a file type; need default variant to display on file_view ctools task, etc.).

DamienMcKenna’s picture

Status: Needs work » Needs review
jwang100’s picture

Category: Feature request » Support request

Hello, I have applied the latest patch file_entity-panels_panelizer_support-1564456-24.patch and I am not able to get the file page to show up under admin/structure/pages.

I am currently using file entity 7.x-2.0-beta1, panelizer 7.x-3..1, and ctools 7.x-1.5.

Any guidance on this would be appreciated.
Thanks

edit:
I decided to go a different route since I was still not able to get it to work.

I do appreciate the support though.
Thanks!

DamienMcKenna’s picture

Category: Support request » Feature request

@jwang100: Please don't change the issue category to ask a question. After applying the patch you'll probably need to clear the site's caches in order for the new "file_view" item to show on admin/structure/pages.

jenlampton’s picture

I'm not using panelizer, just panels + page manager. Just noting that I'm using this patch and it's working so far, we're overriding file/% and the file view mode is looking great. Thanks for the good work so far!

edit: For those who try this, I should note that I am using the Entity: Rendered entity content pane, since both the File: File content pane and the File: File content content panes were not working yet.

DamienMcKenna’s picture

Status: Needs review » Reviewed & tested by the community

I suggest this is good to go as-is, and to work on Panelizer improvements in the Panelizer issue queue.

  • aaron committed 9edf35f on 7.x-2.x
    Issue #1564456 by krisahil, Lukas von Blarer, logaritmisk: fixed Provide...
aaron’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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

Elijah Lynn’s picture

This is in 7.x-2.0-beta2 for anyone wondering.