When implementing a display extender, I get the following PHP strict warning:

Declaration of views_metatags_plugin_display_extender_metatags::option_definition() should be compatible with that of views_object::option_definition()

Sure enough, there is a mismatch.

views_plugin_display:
function option_definition() {

views_plugin_display_extender:
function options_definition(&$options) { }

So either we need to change the base definition of options_definition() or we use a different callback (e.g. options_definition_alter()). This is one of the reasons why I started investigating using drupal_alters() would be easier.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Issue tags: +Metatags

This blocks metatags views integration.

dawehner’s picture

Wouldn't


function options_definition(&$options = array()) { }

work as well?

Dave Reid’s picture

Making a parameter by reference also triggers this warning though.

dawehner’s picture

What do you think about renaming it to options_definition_alter. /me ducks

Alternative the code which runs the methods could merge together the $options.

Chi’s picture

Issue tags: +Code per Views Display
beatnbite’s picture

The metatag views integration is an important thing.
Is there any progress on this issue?

dawehner’s picture

There are several possible ways to do it

a) @ before the function call
b) setting the options in the display plugin object like $object->options and allow to alter it from the display plugin
c) Rename it see #4

In general all seems to be quite hacky.

tim.plunkett’s picture

FileSize
977 bytes

Discussed this with dereine in IRC

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

Thanks! This would probably require a backport as well

dawehner’s picture

Status: Active » Patch (to be ported)

Wrong status

tim.plunkett’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Patch (to be ported) » Needs review
FileSize
1.13 KB

After further thought, both methods should be available.
The first to define options the plugin is directly responsible, the other to alter existing options.

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Setting back after some discussion

Chris Matthews’s picture

Issue summary: View changes
Status: Patch (to be ported) » Closed (outdated)

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue