After installation of the module I got the following messages:

There's a problem in the definition of the behavior openlayers_plus_behavior_blockswitcher. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_blocktoggle. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_themeregion. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_legend. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_permalink. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_scalepoints. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_tooltips. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_tooltips_field. The behavior will be disabled.
There's a problem in the definition of the behavior openlayers_plus_behavior_popup. The behavior will be disabled.

I searched in openlayer module and I found a module function check: function openlayers_behavior_definition_check($definition)

The reason is the mandatory field 'type'.

You can solve the problem in the function openlayers_plus_openlayers_behaviors() on line 82 in openlayers_plus.module add the 'type' field for each behavior.

Example for the first behavior.
Old version:
'openlayers_plus_behavior_blockswitcher' => array(
'title' => t('OL+: Blockswitcher'),
'description' => t('A clone of LayerSwitcher, with better themability and positioning via the Drupal block system.'),
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_blockswitcher.inc',
'class' => 'openlayers_plus_behavior_blockswitcher',
'parent' => 'openlayers_behavior',
),
),
New version:
'openlayers_plus_behavior_blockswitcher' => array(
'title' => t('OL+: Blockswitcher'),
'description' => t('A clone of LayerSwitcher, with better themability and positioning via the Drupal block system.'),
'type' => 'layer',
'behavior' => array(
'path' => drupal_get_path('module', 'openlayers_plus') . '/behaviors',
'file' => 'openlayers_plus_behavior_blockswitcher.inc',
'class' => 'openlayers_plus_behavior_blockswitcher',
'parent' => 'openlayers_behavior',
),
),

Now you will view the behavior in the 'behaviors'-tab in map-edit screen.

CommentFileSizeAuthor
#2 1909440-2-types-and-bit-of-cleanup.diff6.12 KBrob c

Comments

leveller’s picture

I concur that this is a problem if you're using the latest dev version of OpenLayers. I fixed this by adding:

'type' => 'behaviors',

rather than 'type' => 'layer',

Feel free to correct me if this is wrong. Also, I'm not sure that the path belongs in the behavior array; the following extract from openlayers.module would suggest not:

function openlayers_behavior_definition_check($definition) {
  $mandatory_fields = array(
    array('title'),
    array('description'),
    array('name'),
    array('path'),
    array('type'),
    array('behavior', 'file'),
    array('behavior', 'class'),
    array('behavior', 'parent'),
  );

  foreach ($mandatory_fields as $field) {
    $missing = drupal_array_nested_key_exists($definition, $field);
    if (!$missing) {
      drupal_set_message(t("There's a problem in the definition of the behavior <em>!behavior</em>. The behavior will be disabled.", array('!behavior' => $definition['name'])), 'warning');
      watchdog('openlayers', 'Behavior !behavior is unavailable because its
                                plugin definition is incomplete.',
        array('!behavior' => $definition['name']),
        WATCHDOG_ERROR);
      return FALSE;
    }
  }

  return TRUE;
}
rob c’s picture

Status: Active » Needs review
StatusFileSize
new6.12 KB

Can change the name later, not sure.

davidserene’s picture

Status: Needs review » Closed (fixed)

This has been fixed in the latest version of openlayers_plus, please clone from git to get an installation without this error.

davidserene’s picture

Issue summary: View changes

update