Using Drupal 7.59 with PHP Version 7.0.30
Views -> Format -> Show: Calendar Entities - Settings should allow one to
"Set a hex color value (like #ffffff) to use in the calendar legend for each content type.
Items with empty values will have no stripe in the calendar and will not be added to the legend."
When selecting Legend Colors -> Stripes as "Based on Taxonomy" the "Term field"
shows the values for each field in the vocabulary. After making the selections for each color
the "Apply" button is selected and an AJAX HTTP error occurred. Therefore the settings won't save.
HTTP Result Code: 500
Debugging information shows:
Path . . . . admin/structure/views/ajax/display/calendar/cal_month/row_options
StatusText: Service unavailable (with message)
ResponseText: Error: Call to a member function get_option() on null in calendar_plugin_row->options_submit() (line 263 of /home/www/html//sites/all/modules/calendar/includes/calendar_plugin_row.inc).
calendar_plugin_row.inc
258 function options_submit(&$form, &$form_state) {
259 parent::options_submit($form, $form_state);
260 if ($this->view->base_table == 'node') {
261 if (isset($this->view->display['default']->display_options['link_display'])) {
262 $default_display = $this->view->display['default']->display_options['link_display'];
263 $path = $this->view->display[$default_display]->handler->get_option('path');
264 // If this display has been set up as a default tab, the current path
265 // is actually the base path, i.e. if the path is 'calendar/month'
266 // and this is a default tab, the path for this display will actually
267 // be 'calendar'.
268 if ($this->view->display[$default_display]->handler->options['menu']['type'] == 'default tab') {
269 $parts = explode('/', $path);
270 array_pop($parts);
271 $path = implode('/', $parts);
272 }
273 calendar_clear_link_path($path);
274 if (!empty($form_state['values']['row_options']['calendar_date_link'])) {
275 $node_type = $form_state['values']['row_options']['calendar_date_link'];
276 calendar_set_link('node', $node_type, $path);
277 }
278 }
279 }
280 }
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | Screenshot 2022-12-06 at 01.34.39.png | 72.41 KB | klonos |
| CalendarLegendColorError.jpg | 133.77 KB | stevecory |
Comments
Comment #2
stevecory commentedComment #3
klonosHello @stevecory,
Took me some time to figure out what was required in order to test this, but I was unable to reproduce this error with the recent versions of the required modules in Drupal 7.92:
For anyone else trying to reproduce this, here's what I've done:
Comment #4
klonos...I see that the other issue you've created in the Calendar module's issue queue (#2984029: AJAX HTTP error from get_option('path') setting Legend Colors Based on Taxonomy) has also been closed as outdated for some time now, so based on my testing and the inability to reproduce this, as well as the fact that nobody else reported having this issue over the last years, I'm gonna go ahead and close this issue here too.
Thank you for taking the time to report the issue in the first place, and if either you or anyone else are still having this problem with the most recent versions of the required modules, please feel free to reopen, providing any additional information that might help reproduce it.
Cheers
Comment #5
klonos...thought I might as well provide a screenshot from my local testing setup for posterity: