The following errors occur when saving the Row options:
Notice: Trying to get property of non-object in calendar_plugin_row->options_submit() (line 262 of calendar_plugin_row.inc).
Notice: Undefined index: page_1 in calendar_plugin_row->options_submit() (line 262 of calendar_plugin_row.inc).
I happens at the following lines
$default_display = $this->view->display['default']->display_options['link_display']; // This returns a display name..
$path = $this->view->display[$default_display]->handler->get_option('path'); // .. which has no handler
This occurred after upgrading from a recent verson of Calendar to the latest version.
The errors do not occur after rebuilding the view (from a template).
The errors re-appear after changing the name of the 'Month' display, which apparently is $default_display .
Perhaps is is better to point to the 'Master' display, although this is only shown when setting 'Always show the master display' in 'admin/structure/views/settings'.
Comment | File | Size | Author |
---|---|---|---|
#6 | calendar-1545240-6.png | 52.77 KB | star-szr |
#6 | calendar-1545240-6.patch | 2.26 KB | star-szr |
Comments
Comment #1
KarenS CreditAttribution: KarenS commentedI can't replicate this problem, but I can see that in theory there might be a way to have no value for 'link_display'. The master display has no path, so we can't use that. I guess we can check for the existence of 'link_display' and just do nothing if it's missing.
Comment #2
KarenS CreditAttribution: KarenS commentedHere's what I committed. See if you get any more errors after that. I can't test it because I can't find any way to get this error.
http://drupalcode.org/project/calendar.git/commit/b84c870
Comment #3
johnvCan you explain what the purpose is of those lines, so i know what to look for?
Comment #4
KarenS CreditAttribution: KarenS commentedThis comes into play only if you chose the option to link a calendar to a content type. If you choose that option, you get an 'Add Event' (or whatever the name of the content type is) action link on the calendar and a corresponding 'Calendar' link on the node. The default_link tells us the path of the default display of the calendar, which is what we want to link back to. If you build a calendar using the template, the month is the default display.
This bit of code is checking to see if that option is chosen, and if so store the choice in a variable. The variable is used to add the 'Calendar' link to the node in node_view().
Comment #6
star-szrComing from #1614566: Taxonomy label empty when using field via relationship.
I can reproduce this by following these steps:
Attached patch adds another condition and prevents the 500 errors. When the machine name of the default view is changed the link display does not get updated and needs to be re-saved to restore the link to the default display:
Comment #7
silurius CreditAttribution: silurius commentedI can confirm that #6 appears to fix this issue here. (Using Calendar 7.x-3.4+1-dev and Views 7.x-3.7+22-dev.). However, before patching I was experiencing the issue even when using the default machine names.
Comment #8
gonssalI can confirm that the patch in #6 works. Using latest versions at this time (Calendar 7.x-3.5, Views 7.x-3.8, Drupal 7.32). It's a pitty you didn't include this patch into the 3.5 update that was published just a couple of days ago.
I think you should commit it and publish a fast 3.6 update, because this bug breaks functionality.
Comment #9
ron_s CreditAttribution: ron_s commentedI can also confirm the patch in #6 works as expected. No more 500 errors when attempting to edit the legend colors associated with a taxonomy term field. Using the same configuration as gonssal, except with Drupal 7.34.
Comment #10
kmcculloch CreditAttribution: kmcculloch commentedWe came across this issue on some sites we maintain here at the US Courts. We did a $view = views_get_view('our_view_machine_name') and inspected the view. We discovered that the value of $view->display['default']->display_options['link_display'] is 'page_1.' That's the machine name for one of the default views displays, but we had deleted the 'page_1' display.
So we went to the view and added a page display named 'page_1' at a /foo/bar/baz nonsense path and disabled it. Now the plugin code finds a page display called 'page_1' and we no longer get the ajax error.
I'm not sure why the view's default values reference a display that no longer exists. This particular plugin might be blameless: perhaps some other part of the views system should have changed the default value when we deleted the 'page_1' display.
Nevertheless, it seems to be the case that sometimes a view's defaults reference a display that does not exist, so I still think the patch to check for its existence is a good idea and should be incorporated into the module.
Comment #11
joelhsmith CreditAttribution: joelhsmith commentedThanks kmcculloch . I can confirm your #10 work around.
Comment #12
Neslee Canil PintoComment #13
ron_s CreditAttribution: ron_s commentedThis patch is not outdated. It is a reproducible problem, and the solution is still valid and effective.
I'm marking patch #6 as reviewed and ready to be committed. It still applies to the latest 7.x-3.x-dev.
Comment #15
Neslee Canil Pinto