Today panels module version 3.7 was released and panels_tabs doesn't work fully with the new rendering pipeline.

If you upgrade a site it should continue working ok, but it will switch panels into legacy mode which does limit some of the new features. It would be great if there was a way to upgrade fully.

The first step to get this upgraded is here:

#865840: How to upgrade a style to be legacy free

However, this does then show a problem due to a change in the way the region rendering now happens:

#865912: Document how to allow region styles to control rendering of panes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kmv’s picture

subscribe

dawehner’s picture

I tryed to do this.

The problem is that it's not that easy to get the title of a pane as you saw in the other issues.
It's not a problem to remove the title from rendering.

smoothify’s picture

I made some progress on this today and will try to post a patch for this tomorrow.

merlinofchaos was very helpful, and suggested a way to allow fallback for people running the older versions of panels too.

dawehner’s picture

Perhaps it would have been better if we changed some words via irc :)

He suggested to add a deprecated-plugins/tabs.inc to support older versions, too.

pvasener’s picture

Subscribing

smoothify’s picture

Status: Active » Needs review
FileSize
3.46 KB

Here is the patch as promised against the current dev version.

In this version I actually kept a single style, rather than going for the separate deprecated one. (I do check for the version in several places though)

The reason for this is so that it works in the following situations:

1) Previous versions of panels/ctools

2) Latest version of panels/ctools in legacy mode (due to other 'legacy' styles)

3) Latest version of panels/ctools in regular mode

Number 2), is where I believe it would have issues on the separate style method - not only would you have to check for ctools version, you also have to check whether its running in legacy mode.

I have enquired on #865840: How to upgrade a style to be legacy free if its fine to leave both the new 'render region' and the older 'render panel' callbacks inside the one style rather than separate ones. If it is fine then there scope to remove some of the duplicate render code added by my patch.

dawehner’s picture

Status: Needs review » Fixed
dereine: Yeah the old render panel callback won't be used by the new and render region won't be used by the old.

Thanks. And commited.

pvasener’s picture

Version: 6.x-1.x-dev » 6.x-1.0-rc1

I updated the module to 6.x-1.0-rc1. I no longer have the panels warning for panels_tabs and I'm still in legacy mode due to another module (skinr). When I try to access a panel page, I now get the following error. All non-panel pages are ok though.

PHP Fatal error: Call to undefined method panels_renderer_legacy::prepare() in /var/www/html/***/sites/all/modules/panels_tabs/panels_tabs.module on line 38,...

dawehner’s picture

Please open new issues.

Which version of ctools and panels are you using. I just want to support the newest version if possible.

pvasener’s picture

Status: Fixed » Needs work

I use Panels 3.7 and Ctools 1.7

dawehner’s picture

Status: Needs work » Postponed (maintainer needs more info)

I need a way to reproduce the problem. Here it works fine

smoothify’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
1.12 KB

I have managed to reproduce this issue by installing a style using the old format which put panels into legacy mode. (needed a few cache clears and refreshes though)

The issue seemed to be with the code to check the version, however when I ran an additional check to see if panels was in legacy mode it fixed the errors but the tabs were missing titles.

It seems that if you specify api version 2 as we do, the panels legacy mode, tries to be a bit clever and run the new 'render region' callback anyway. The callback doesn't work because I was relying on the renderer->prepare function which is only in the standard mode in my code.

So in the end, I have rewritten the pre_render hook to work which ever mode panels is in.

Hope this solves things...

bennos’s picture

last patch works for me

pvasener’s picture

Status: Needs review » Fixed

Same thing, the patch fixed my problem. Thanks a lot.

dawehner’s picture

Status: Fixed » Reviewed & tested by the community

Don't close issues, if the patch is not already commited :)

smoothify’s picture

Status: Reviewed & tested by the community » Needs work

Just testing things more, and it seems it doesn't work too well when assigning the tabs style to the whole panel (e.g. when using tabs in mini panels)

Will follow up with a patch once I work out why.

smoothify’s picture

Status: Needs work » Needs review
FileSize
1.41 KB

Here is another patch, based on 1.0 rc1. (this replaces the last patch)

Now it checks to see if the overall panel has a style, and if so it processes the all regions correctly, honoring those that have a separate style.

fingers crossed this time it works fully!

dawehner’s picture

Status: Needs review » Fixed

And commited. Thanks again!!

pvasener’s picture

Version: 6.x-1.0-rc1 » 6.x-1.0-rc2

I'm testing 1.0-rc2 on my system and I get the following warning on any panel page:

warning: Invalid argument supplied for foreach() in /var/www/html/drupal/***/sites/all/modules/panels_tabs/panels_tabs.module on line 45.

and the titles of the tabs are not displayed on the tabs but in the tab content as a regular title.

smoothify’s picture

pvasener:

could you tell me which mode panels is running in on the status report - /admin/status/report ?

are you using ctools 1.7 and panels 3.7?

smoothify’s picture

Status: Fixed » Needs review
FileSize
588 bytes

I managed to reproduce the issue with the titles not showing in the tabs, but not the invalid argument error.

I experienced the titles missing when using mini panels and with the style applied to all the display. I have attached a patch that should this.

pvasener

If this doesn't fix your issue, could you give some more information on whether you are using mini panels and where you are applying the style.

pvasener’s picture

Panels 3.7 is working in legacy mode with Ctools 1.7. I am not using mini-panels and I applied the 'tabs' style to a region with two custom content panes. I tried patch 4 but the problem persists, sorry.

smoothify’s picture

pvasener, thanks for the feedback

do you know which style is causing the legacy mode, skinr perhaps? (should tell you in the status report)

I can't reproduce this situation on my setup - could you export your panel so I can try exactly the same one here?

smoothify’s picture

pvasener,

just to rule out the obvious - have you run update.php since upgrading panels & ctools? also have you cleared caches?

pvasener’s picture

Yes, I'm in legacy mode because of Skinr. And yes, I have 'drush up;drush cc all'-ed before testing :)

Concerning the faulty panel, it's indeed not a panel page but a panel node. I tried to create a new panel page and a new panel node and the bug only occurs on a panel node (Everything is ok on a panel page). I hope this helps to reproduce it.

smoothify’s picture

ah, panel nodes...

I still can't reproduce this error - could you try the following (you need devel installed)

on line 42 of panels_tab.module underneath the $global_style declaration could you add the following :


drupal_set_message(dpr($renderer->plugins, TRUE));
drupal_set_message(dpr($renderer->plugin, TRUE));

When you view the page now, you should see a message shown with some debug output, could you paste here?

Thanks

Ben

pvasener’s picture

Here is the result of your request:

Array
(
    [layout] => Array
        (
            [title] => Flexible
            [category] => Builders
            [icon] => flexible.png
            [theme] => panels_flexible
            [admin theme] => panels_flexible_admin
            [css] => flexible.css
            [admin css] => flexible-admin.css
            [settings form] => panels_flexible_settings_form
            [settings submit] => panels_flexible_settings_submit
            [settings validate] => panels_flexible_settings_validate
            [panels function] => panels_flexible_panels
            [hook menu] => panels_flexible_menu
            [builder] => 1
            [builder tab title] => Add flexible layout
            [get child] => panels_flexible_get_sublayout
            [get children] => panels_flexible_get_sublayouts
            [ajax] => Array
                (
                    [settings] => panels_ajax_flexible_edit_settings
                    [add] => panels_ajax_flexible_edit_add
                    [remove] => panels_ajax_flexible_edit_remove
                    [resize] => panels_ajax_flexible_edit_resize
                    [reuse] => panels_ajax_flexible_edit_reuse
                )

            [module] => panels
            [name] => flexible
            [path] => sites/all/modules/panels/plugins/layouts/flexible
            [file] => flexible.inc
            [plugin module] => panels
            [plugin type] => layouts
            [description] => 
        )

)
Array
(
    [handler] => Array
        (
            [class] => panels_renderer_legacy
        )

    [module] => panels
    [name] => legacy
    [path] => sites/all/modules/panels/plugins/display_renderers
    [file] => legacy.inc
    [plugin module] => panels
    [plugin type] => display_renderers
)
smoothify’s picture

Thanks for the debug information - its very helpful.

I hadn't tested flexible layout in legacy mode, which is what seems to be causing the problem - it may be a panels bug rather than with panels_tabs.

I will investigate this further and see if i can find a work around.

Edit: forgot to mention - with this info I can now reproduce the problem.

pvasener’s picture

I can also confirm you that it's coming from the 'flexible' layout. I modified the layout to a 2-column one and the problem disappeared. When I reverted to flexible, the problem was back.

smoothify’s picture

FileSize
931 bytes

okay,

i found a way round this issue, and for me it now fixes the problems using flexible layout in legacy mode.

This patch applies against RC2, and also contains the change made in patch 4. So if you've applied patch 4 its best to redownload the module and then apply it.

pvasener’s picture

This patch fixed my particular problem. Thanks a lot for your efforts in solving it.

smoothify’s picture

great! really pleased it works for you now.

thanks for providing the feedback, made things much easier.

mcpuddin’s picture

This may or maybe unrelated to the bug but when I applied the patch to RC2, I get the following error when trying to add the tab style to a mini panel ( a regular page via page manager works fine ):

Unable to complete operation. Fatal error in www/sites/all/modules/contrib/panels/plugins/display_renderers/panels_renderer_editor.class.php on line 1674: Function name must be a string

smoothify’s picture

mcpuddin:

That sounds like the issue with panels I ran into yesterday:

#865704: Fatal error in panels/plugins/display_renderers/panels_renderer_editor.class.php on line 1669: Function name must be a string

That has the patch in there, but it has been commited and released, so you may try downloading the latest panels release.

smoothify’s picture

Assigned: Unassigned » smoothify
Status: Needs review » Fixed

Commited!

and new release candidate created...

Status: Fixed » Closed (fixed)

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