Closed (fixed)
Project:
Event
Version:
6.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2008 at 09:29 UTC
Updated:
26 Apr 2008 at 01:53 UTC
Jump to comment: Most recent file
Comments
Comment #1
cjeanson commentedI can confirm this, I just tried to check out my own day view and it doesn't retrieve the proper data.
I did some testing (limited due to my lack of knowledge) but it seems to revolve around the relevant code if statement:
Now, the if statement comes up false, and so it runs the latter of the two. I edited the latter to print out a test statement and sure enough it printed it out.
So, $show_calendar_link (If a link to all the events of this type should be shown) is not being set or is set to false.
So, I took out the if statements and I just ran the code. Guess what comes up? The labels come up, but nothing event-related comes up. Hmmm...
Comment #2
lnknpk04 commentedI noticed the same problem and found this thread. Definitely an issue.
Comment #3
pobster commentedDid no-one else notice the error messages thrown up in the log? See attached...
(As they appear in the logs - so chronologically they're backwards)
All from Location: http://www.xxxxx.com/event/2008/03/02/feed/all/all/
preg_match() expects parameter 2 to be string, object given in /var/www/drupal/htdocs/includes/bootstrap.inc on line 718.
Object of class stdClass could not be converted to string in /var/www/drupal/htdocs/includes/bootstrap.inc on line 715.
mysqli_real_escape_string() expects parameter 2 to be string, array given in /var/www/drupal/htdocs/includes/database.mysqli.inc on line 323.
date_parse() expects parameter 1 to be string, array given in /var/www/drupal/htdocs/sites/all/modules/event/event.module on line 2793.
date_parse() expects parameter 1 to be string, array given in /var/www/drupal/htdocs/sites/all/modules/event/event.module on line 2793.
Pobster
Comment #4
killes@www.drop.org commentedComment #5
cjeanson commentedFixed? As of the latest update, it still doesn't display events other than a >
Am I doing something wrong? Still seems broken to me.
Comment #6
killefiz commentedI can confirm that it still doesn't show content on the day view.
Example: http://www.ssv-niederkruechten.de/event/2008/03/16/day/
Comment #7
Morn commentedSeems to be fixed in the march 30 Version (don't forget to run update.php after uploading the new version)
Comment #8
cjeanson commentedDoes the latest version fix the issue in http://drupal.org/node/220855 without errors?
Comment #9
pobster commentedIt's not fixed, in fact it's worse than ever - all my views; month, week and day show unclickable... just showing the stripe lines rather than event titles, I've rolled back to the Feb 11th release, it's the only one which appears to be working (probably because it's pre-tpl files...) In the current release the only thing which does work is the table view and that's probably because it references $node in the function callback rather than $variable (which the rest expect) - $variable is always NULL as far as I can tell.
And BTW, there is nothing to update in update.php - in fact it's pretty clear in http://drupal.org/project/cvs/3238 that no update has been made to the .install file in ages (two months).
Pobster
Comment #10
pobster commentedOkay on closer inspection it seems that hook_template_preprocess is NOT called for any of the tpl files resulting in blank entries. This is why some views work and some don't as not all the views actually use this hook, only day, week and month according to the event.theme file. There doesn't appear to be any hook_theme_registry_alter call to register the preprocess callbacks? I'm not sure if this is necessary but advanced_forum uses it and that works fine?
edit: okay so it IS called... As Drupal recognizes a duplicate function if you make one - but for some reason it's not calling/ registering it?
Pobster
Comment #11
pobster commentedOkay I've narrowed the bug down to the template_preprocess_event_node_day/week/month functions. NONE of the variables are having any effect, hence they're NULL in the tpl files. I did notice that a couple of variables look to $node for values, when $node isn't defined at all - but that shouldn't cause ALL the variables to be empty?
Pobster
Comment #12
pobster commentedOkay... The problem *is* how Drupal registers the template_preprocess hooks and is probably to do with them being in an include file which isn't always included.
SOLUTION: Cut and paste ALL the hook_template_preprocess_event_node_* callbacks from event.theme to event.module and everything works fine. Well... Nearly everything... For the functions which look for a $node variable which doesn't exist (edit: all of them...) add this line to the top of the function;
$node = $variables['node'];I *know* this isn't a patch, but setting the status differently shows at least there is a solution for people having the same issue (which will be everyone who uses this module)... Note that if you return everything back to where it was and clear the cache/ enable a module/ anything which forces Drupal into re-evaluating its hooks then the problem *will* reappear, for now I'd suggest leaving all those functions in the .module file.
Pobster
edit: IMPORTANT!!! Don't forget to clear your cache after you've made the change else Drupal will look to the old cache for its information rather than build you a new and working events calendar.
Comment #13
JohnT commentedThe fix in #12 worked at my site - thanks!
I have a separate thread going on this topic, I'll go post a link to this discussion over there.
Comment #14
Clemens commentedThank you pobster... I am having some difficulties interpreting your instructions. It would be great if you could be somewhat more specific for the non-coders out there.
Comment #15
JohnT commentedPaste these three functions into event.module, and remove them from event.theme:
Note - I've already made the change mentioned in pobster's post ($node = $variables['node'];)
Upload both of those modules, and delete the rows from your cache table in the database - that should fix it!
Comment #16
Clemens commentedPerfect JohnT... You must have been sitting there waiting for me. Talk about excellent service. Thank you. Worked perfectly.
Comment #17
JohnT commentedNo problem - and just a coincidence on the timeing, I had this site open in a tab that I was going to close, just thought I should take a look at it first, so you got lucky! Time to go buy a lottery ticket? And oh, yeah - I never did close the window...
One more note - this isn't an approved patch, they're likely to issue a real fix sometime soon, so keep an eye on your available updates.
Comment #18
Morn commentedUntil yesterday I didn't need the patch, everything looked ok.
Today it happened (although there was nothing added/changed):
an "include file which isn't always included" wasn't include.
So I patched as in #15, cleared the DB Cache, and.... IT Works!!.
Thx to pobster and JohnT.
Comment #19
gerhard killesreiter commentedNo patch here. I believe I fixed it anyway with today's commits. You'll need to clear your cache for it to be effective.
Comment #20
pobster commentedAgain with the "there isn't a status for 'change these few lines' to make it work", it's pointless rolling any patches with dev versions such as this as my module code differs from the original hugely - I'm not messing around with patch files for the sake of being able to use a status message... Having instructions on what to patch is warrant enough for changing the status in my opinion...
...but anyways rant over, that isn't really a discussion for this thread! And cheers for fixing it! ;o)
edit: I've just noticed that you're still trying to reference the $node variable when you've not defined it anywhere in the template_preprocess hooks. Obviously all that's needed is only a simple;
$node = $variable['node'];Pobster
Comment #21
pobster commented...and nope todays release doesn't fix this issue. Mind you, I can't see where you thought you'd fixed it from the revision logs anyway? The issue is the placement of the template_preprocess_hooks when the cache is rebuilt, meaning the event.theme file isn't always included and so neither are the hooks... Wouldn't it be better to just simply put these hooks into the module file to be *sure* that they're always called...?
Pobster
Comment #22
gerhard killesreiter commentedAh, I got the problem now, I'll see how others handle this
Comment #23
ggroger commentedCan you upload these files patched???
Thanks!!
Comment #24
gerhard killesreiter commentedthis is now fixed.
Comment #25
dorgeo1 commentedIt does seem to work for me. The month view shows the teasers or full body which makes for a large calendar. Any way to make the month view like the week view showing only the title, date, and time?
Comment #26
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.