Hi,
I tried creating a custom display plugin for views, that would be treated like a view panels pane. So I extended views_content_plugin_display_panel_pane, I was able to get my plugin working, but panels did not treat it like view pane rather a regular view display. I tracked it down to this line of
function _views_content_panes_content_type($view, $display) {
// Ensure the handler is the right type, as Views will fall back to
// the default display if something is broken:
if (get_class($display->handler) != 'views_content_plugin_display_panel_pane') {
return;
}
Changing that to
function _views_content_panes_content_type($view, $display) {
// Ensure the handler is the right type, as Views will fall back to
// the default display if something is broken:
if (!is_a($display->handler, 'views_content_plugin_display_panel_pane')) {
return;
}
Allowed my new plugin to be treated like view pane.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | check-object-class-1992680.patch | 729 bytes | iamjon |
| #1 | check object class-1992680.patch | 729 bytes | iamjon |
Comments
Comment #1
iamjon commentedPatch
Comment #2
iamjon commentedRemoved space
Comment #3
merlinofchaos commentedSetting proper status.
Comment #4
miroslavbanov commentedIt works great. Without it, you don't see the overriden/extended view pane as a ctools content in the "View panes" tab or anywhere else in a panel.
Comment #5
japerryTested, fixed, and committed:
http://drupalcode.org/project/ctools.git/commit/95c89481ccf1059bb7754122...
Comment #6
miroslavbanov commentedApparently, this would produce errors on php 5.4
http://www.php.net/manual/en/function.is-a.php
5.0.0 This function became deprecated in favour of the instanceof operator. Calling this function will result in an E_STRICT warning.http://www.php.net/manual/en/function.error-reporting.php
5.4.0 E_STRICT became part of E_ALL.Comment #7
iamjon commentedIt seems this function is still valid for php 5.4. I'll test in a second to confirm.
http://il1.php.net/is_a
Changelog ¶
Version Description
5.3.9 Added allow_string parameter
5.3.0 This function is no longer deprecated, and will therefore no longer throw E_STRICT warnings.
5.0.0 This function became deprecated in favour of the instanceof operator. Calling this function will result in an E_STRICT warning.
Comment #8
japerryRe-marking fixed.
It looks like it might throw an error with php 5.2, but we no longer support 5.2 so thats okay.