Closed (outdated)
Project:
Event
Version:
5.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Mar 2006 at 18:52 UTC
Updated:
13 Apr 2018 at 20:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Patrick Nelson commentedComment #2
sanduhrsI can confirm this bug, but not your solution.
The mentioned line seems to be on line 1590 now, but it doesn't change behaviour if replaced as suggested.
The Dropdown "Select event type to filter by" which appears if taxonomy is enabled, doesn't show the defined types.
Also the link "limit view to events of this type" doesn't show the expected result, instead it still shows all events of all types.
And, if JavaScript is disabled theres no way to send the form ("Select event terms to filter by" and "Select event type to filter by").
Any hints on where the problem lies?
Drupal4.7RC2
Event4.7 and CVS
Comment #3
rubenk commentedConfirmed. I too have this problem. I can filter by term but not type. I am using different flexinodes for each calendar type and enabling/disabling people from seeing some of the flexinodes but I want people to be able to select different calendar views themselves as well.
Comment #4
rubenk commentedThe fix provided by Patrick Nelson does indeed work. Implementing it allows for the page to refresh when an item in the list is clicked however there is a separate issue where it looks like all node types MAY not populate the list. For example, I have three calendars (event, water systems, and awra). The list only shows (top to bottom) white space, awra, white space. The list isn't being populated correctly. Any thoughts?
Comment #5
rubenk commentedLooks like the dropdown list gets populated fine but there are additional null or blank spaces at the top and bottom of the menu: "" at the top and a "" at the bottom of the menu. Not sure why this happens. When those are clicked on, it takes you back to the all events calendar. It should also be noted that the "events" type cannot be selected, although events may not be selectable because it is not a separate flexinode?!?
Can anybody reproduce this in CVS? Don't forget to use the patch mentioned at the top of this first.
Comment #6
rubenk commentedI would like to bump this and request someone makes a diff please (As per above).
It does help BUT
There is still a problem: when changing types, the available taxonomy terms are not changed (i.e. all of them are there when only ones suitable to that type should. See http://drupal.org/node/62704
Comment #7
rubenk commentedCould the problem with the taxonomy be located in the same location?
/**
* Returns a dropdown event-enabled content type input control.
*
* @ingroup event_support.
* @param $tid The current term id.
* @param $submit Adds 'onChange' form submit javascript command to control.
* @return A form with a dropdown event taxonomy term input control.
*/
function _event_get_type_control($curtype = NULL, $autosubmit = TRUE) {
if (module_exist('taxonomy')) {
/**
DOES THE FOLLOWING OCCUR for ALL TERMS?
*/
$results = event_get_types('all');
$items['all'] = t('(all)');
foreach ($results as $type) {
if (module_hook($type, 'node_name')) {
$items[$type] = module_invoke($type, 'node_name', $node);
}
elseif ($ctype = module_invoke('flexinode', 'load_content_type', substr($type, 10))) {
$items[$type] = $ctype->name;
}
}
$form['event_type_select'] = array(
'#type' => 'select',
'#default_value' => $curtype,
'#options' => $items,
'#description' => t('Select event type to filter by'));
if ($autosubmit) {
/**
Type changing FIXED on the line below
*/
$form['event_type_select']['#attributes'] = array('onChange'=>'this.form.submit()');
}
$form = drupal_get_form('event_type_filter', $form);
return theme('event_filter_control', $form);
}
}
/**
* @defgroup event_block Functions for event blocks.
*/
Comment #8
sanduhrs#6 : So here is your patch.
vg
Comment #9
rubenk commentedThank You so much. Can this be committed as the first step or does the taxonomy issue have to be corrected first?
Comment #10
rubenk commentedComment #11
killes@www.drop.org commentedapplied
Comment #12
urbanfalcon commentedStill broken for me. Could this be related to the new module naming structure? The module hook as stated above is looking for node_name, but according to the developer docs:
In 4.6, you had hook_node_name and hook_node_types. Now you must implement hook_node_info if you want to create a module which defines node type(s).Comment #13
gerhard killesreiter commentedwhich version do you use? Please look at the cvs version inside the event.module file (at the top).
Comment #14
urbanfalcon commentedAt line 238, I found if I replaced this:
with this:
I could use the querystring to filter by node type. This plus what was in my previous post were the fixes for my installation, even after I grabbed the patched CVS copy that was committed (which unfortunately still kept me from filtering by node type).
Comment #15
rubenk commentedInteresting. The original post fixed my problem. However, would it be a good idea to change hook node name to hook node info? Anybody else have this problem? Also, how did commenting out types null help? - Lastly, I've made the necessary changes to a few lines of code to only show terms that are associated with the filtered node type(s) rather than showing all the possible terms (including those associated with other node types). However, I am working out of windows and haven't quite figured out how to make a diff.
Comment #16
rubenk commentedIn response to sanduhrs: if javascripts are Enabled in the browser window, then after applying Nelson's patch (changing event_term_select to event_type_select) resulted in me: being able to filter by term and type successfully. With javascript Disabled, I can do neither. To be honest, I think this module needs javascript to self-post.
Urbanfalcon: In the end, did you (a) apply the event_term_select to event_type_select change, (b) change hook_node_type, and (c) comment out types = null to get the same result as me, that is, being able to filter by term and type successfully (with javascript enabled)?
Comment #17
urbanfalcon commentedAll of the above, but only "c" seemed to really get the job done for me, enabled javascript or no.
Comment #18
nevets commentedI think this may solve the problem. In the function _event_get_type_control() it calls event_get_types() which I believe returns type names. But _event_get_type_control treats them as module names. I think the code should look like this
This will produce an drop down with the event types filled in (not tested though with flexinode).
Also note, I also believe the outer if checking for the taxonomy module should be removed.
Then in event_page() [around line 276] replace
with
and the calendar will filter by type.
Comment #19
japerryEvent for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.