The calendar plugin style does not allow usage of inherited calendar_plugin_row_node. I need to inherit the style and change how the start & end date fields are identified as i have a complex widget developed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sukr_s’s picture

I've created a patch for the same. will be great if this can be applied.

Todd Young’s picture

I am experiencing the same problem. Neither upgrading to all latest DEV's nor the above patch worked for me? I am using yesterday's Alpha-1 release.

'calendar_plugin_style: Missing calendar row plugin'
in calendar_plugin_style->render() (line 208 of /xxx/yyy/zzz/sites/all/modules/calendar/includes/calendar_plugin_style.inc).
sukr_s’s picture

@Todd: Your issue would not be related to the one for which i've included a patch since I've extended the default calendar pluging of the module and need the core module to support the extentsion.
For you problem you may want to try the following
1. clear all cache
2. clear views cache
3. edit the view and check if the Format is Calendar and Show is Calendar Items

Todd Young’s picture

Success! After upgrading my SHOW had reverted to 'fields' for some reason - thank you!

KarenS’s picture

Category: bug » feature

I'm trying to understand the original issue. You mean you have created a custom handler that extends the calendar row handler? For that we can test using is_a or instanceof. See how it is done in the date_views_handler_is_date() function in the Date Views module. We can provide something similar to that in Calendar.

You can rework your patch to use this or I will try later.

I would not characterize this as a 'bug', it is a feature request, but a reasonable one.

sukr_s’s picture

Karen,
your understanding is right, i've a custom handler derived from calendar row handler. I've also adopted the patch as per your suggestion to use instanceof. Would be great if you can review and apply the same.
Sudhir

gtrennert’s picture

Hello,
I get this message too :
'calendar_plugin_style: Missing calendar row plugin'
dans calendar_plugin_style->render() (ligne 205 dans ..\sites\all\modules\calendar\includes\calendar_plugin_style.inc).

The first patch did not change anything
The second one gives me a lot of this messages :
Notice : Undefined index: style_plugin dans calendar_granularity_path() (ligne 197 dans ...\sites\all\modules\calendar\calendar.module).

I followed this step by step : http://drupal.org/node/1250714

bigjim’s picture

While the patch in #6 worked fine for me, I'm wondering why this check is there at all. Why do we care if it's a calendar_plugin_row_node row plugin? I might be missing something here but it doesn't seem to me this style plugin is dependent on the Node entity (other than a few theme naming conventions)? I was able to write a row plugin that works perfectly well on an entity (actually not event an Drupal entity but CiviCRM Events) that uses calendar_plugin_style.

Though I needed to cut that check in the if() statement to make it work (btw my plugin drops all the OG and Taxonomy support, in part not shown in my code).

@@ -207,7 +207,7 @@ class calendar_plugin_style extends views_plugin_style {
   }
 
   function render() {
-    if (empty($this->row_plugin) || $this->row_plugin->definition['handler'] != 'calendar_plugin_row_node') {
+    if (empty($this->row_plugin)) {
       debug('calendar_plugin_style: The calendar row plugin is required when using the calendar style but it is missing.');
       return;
     }
KarenS’s picture

Status: Active » Fixed

The test for a calendar row plugin is needed because the style won't work at all for other row plugins, like the field plugin or the content plugin. If someone tried to use those row plugins the calendar would have nothing to display (none of the calendar info added by the plugin would be available), and in fact it will start to throw all kinds of errors because values that the plugin should have added are missing. So this is intended to keep users from creating calendars that won't work.

I committed a variation of the patch above, which actually has two different patches and neither is right.

The right test is

$this->row_plugin instanceof calendar_plugin_row_node

rather than

$this->row_plugin->definition['handler'] instanceof calendar_plugin_row_node

http://drupalcode.org/project/calendar.git/commit/f440bef

If anyone wants to create other row plugins that will work in calendars, you need to extend the ones we have and be sure not to wipe out important values it creates. Currently there is only a node plugin. My plan is to create others, possibly including a generic one for entities that aren't nodes. This is the same way that Views uses the row plugins, they are intended to provide handling specific to a certain type of entity, like the row striping by content type.

In fact, now that this is working fairly well, I may step back and create generic row plugin that would work on any entity type, then have the node row plugin extend that instead. This belongs in a separate issue, and patches are welcome.

Status: Fixed » Closed (fixed)

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

johndieter’s picture

Status: Closed (fixed) » Active

well, what is the fix? all the latest versions and NO calendar works. row plugin missing...

mjhmobilemedia’s picture

I figured out how to fix this issue, so I thought I'd share how I did it:

The problem is in the Event Calender View. Under Format, change the Row Settings to Calender Item. Under the Settings, I also set Add New Date Link to Event.

You have to do this for each display separately: Month, Week, Day, Year and Block.

Missing Style Plugin 001

Missing Style Plugin 002

Missing Style Plugin 003

KarenS’s picture

Status: Active » Fixed

This is a feature request about extending the plugin, not a bug report about a missing plugin. The feature request was taken care of.

Status: Fixed » Closed (fixed)

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

DWyeth’s picture

#12 fixed it for me - thanks mjhmobilemedia