Hi

I enabled your module, copied datas from birthday into profile (using synchronize)
but new registered users (I set them birthday date for tomorrow) or existing users with changed birthday (to tomorrow too)
doesn't show in birthday block (n birthdays)

I can see their changed birthday on their profiles, but birthday block show this user with old birthday.

I have problem with access to this block, only admin can see this block. If I set all roles except admin allowed to see this block, sill just admin can see this block and no other users or anonymous. I disabled block cache (although for this block I didn't use block cache, but it doesn't helped.

Igor
somvprahe.sk

Comments

igorik’s picture

I tried to disabled and uninstall this module (and disabled almost all others modules too), and then enabled birthday modul, but still the same problem.
current state is that birhday module shows:
"Nobody is having their birthday soon."

although some users have birthday tomorrow.
when I click on more, I can see the page with missorder users, the first is admin with birthday tomorrow, (he was not shown in block!)
but other users are weird

admin 11/08/1977 29
ria
sona 01/01/1900 107 capricorn
tamara 17/08/1977 29 leo
maros
helusik 00/00/0
Andy 24/11/1900 106 sagittarius
vladko

Please note that after unistalling and new enabled module is still the same problem that admin only can see birthday block (although every roles except admin are enabled for seeing it)

Igor
somvprahe.sk

maartenvg’s picture

Status: Active » Postponed (maintainer needs more info)

Can you give me a link to the site? I then have a better picture of what's showing what and maybe why, because I'm guessing a lot here.

For instance, are you sure you have set the block to show more than 1 day in advance, because that would explain why it doesn't show the birthdays of tomorrow. You can set this in the block settings at admin/build/block/configure/birthdays/by_days. It should, by default, show 7 days in advance. Another reason might be that the {dob} table is empty. Can you check that? And what does the other block show (the one that just simply shows the N upcoming birthdays)? That one should always show N birthdays. Can you check that aswell?

I think the strange dates you see are the result of the bugs in the old version. The old version sometimes saved the 01-01-1900 dates and did strange things with the year information. These were then saved in the {dob} table. With the wrong data in the {dob} table, these are also present in the new module (as it uses the same data) and in the profile-module (after synchronizing).
To solve this (if that is the problem indeed the problem), everybody who has a strange date, needs to change his/her profile to the correct date. Or you have to do it for them. At the moment it's not possible to remove a already set birthday, I think it's a good idea to alter this and add a button to reset the birthday of the user.

Concerning the blocks:
Did you set the user access (admin/user/access) to grant the appropiate roles the right to access birthdays? If not, that should solve your problem.

Lastly the bug concerning not being able to change the birthdays. I haven't a clue at this moment why that happens. The blocks and the user-profiles use the same date formatting system and the same data source. Therefore, if it shows correctly in the profiles, it should show correctly in the blocks. I definitly need an example website for this to figure this one out. Make sure to set the appropiate user access to make sure I can see something. It seems, again, that nothing is saved to the {dob} table. Does drupal report any MySQL errors in the logs?

igorik’s picture

Hi,

you are right, the problem that the block was not shown nobody except admin was my mistake about user access, such dumb thing :)
I am sorry.

In block settings I had set 6 latest results, but the block has no results in itself although I can see that some users have their birthdate in profiles.
this block is about last x birthdays, there are no settings for date (you thought the birthdate date block probably)

You can see it here: (my developing site)
User Kraken http://somvprahe2.drupal.cz/user/kraken
User Admin http://somvprahe2.drupal.cz/user/admin
Birthday block is on the top of the left collumn
Birthday page is here: http://somvprahe2.drupal.cz/birthdays
Admin is ok, but user Kraken who has birthday 12 aug 1977 there isn't (somewehere on the top)
and nobody of them is in birthday block.

I looked into DOB table, and you are right, it is empty.

Thanks
Igor

maartenvg’s picture

Can you try synchronizing profile to birthdays? (the other sychronization). This should fill the {dob} table again and thus show some people in the block.

Now I think of it, I think I know why your {dob} table is empty: you said you uninstalled to module completely (using drupal) when you encountered that memory overload problem. That drops the {dob} table, and when you installed it again an empty {dob} was created.

This doesn't explain why the new and edited users aren't ending up in the {dob} table. But it at least gets us a bit closer to the solution.
Please sync back and see if new users (or edited ones) are ending up in the {dob} database (and in the block).

igorik’s picture

Hi, I did synchronize now, and it filled table and birthday block. so it is fine.

but the problem is still there - after synchronize when I add new user or set to him/her a birthdate (tomorrow),
this user is not added into birthdate list

I set birthdate for user Ria
http://somvprahe2.drupal.cz/user/ria
after I did synchronize, and she is not in block
but she is on the top of the birthday page what is ok.
http://somvprahe2.drupal.cz/birthdays

I just created new user
http://somvprahe2.drupal.cz/user/justnewuser
with birthdate of today
but the same probles as above and this user is right on the end of the list on birthday page not on the top.... really weird I think.

Please feel to free if you will be want to create new user on this test page.

good luck, I will be back about 8 hours.
Igor

maartenvg’s picture

The only thing I can think of is that in some cases birthdays_save_user() isn't called properly or something like that. That would cause new users and edits to be saved in profile table, but not in the {dob} table and also new users wouldn't show a star sign (which is the case on your test site).

This is strange, because the synchronization uses birthdays_save_user() too, but that still does its work properly, right? Plus that I can't reproduce this in any way.

Can you insert the following code around row 632 after function birthdays_save_user(&$edit, &$user, $category) { to check whether birthdays_save_user() is called?

drupal_set_message("I'm in birthdays_save_user()",'error');

Then try to edit the birthday of a user and see whether the error string appears when you save. If it does, move that piece of code within the first if-statement and repeat the editing. If it still shows, place it in the last if-statement and repeat again.

Then tell me what happened.

igorik’s picture

Hi

On the start of function and in the first if, the message is shown, in the second if no.
I removed profile date field and created new, but nothing happends, the same errors.

After I did synchronize again, then are edited users shown in birthday block. But not right after editing.
(there is your php message shown twice after synchronize)

I found other weird thing (It can have something with synchronize)
This user is on birthday block list, with data: Kraken (30) 12/08
http://somvprahe2.drupal.cz/user/kraken
But in his profile I can't see his birthdate, and when I am going to edit it, date in birthday date field is current date
(after editing it and submit form, the birthday date is shown on his profile)

I hope that it helps.
Igor
somvprahe.sk

maartenvg’s picture

Can you go to birthdays settings (admin/settings/birthdays) please and press 'save configuration' for me again? I have the impression that your profile field name isn't registered correctly, and saving can reset that.

Then try adding and changing stuff again.

igorik’s picture

Hi

I did synchronize again,
then save the settings,
then go to user profile of user which have in birthday block "igorik (30) 12/08"
when I was on edit profile page of this user, the date field has current date 11 08 2007 :(
I save changes (to 11 08 1945)
message I'm in birthdays_save_user() was shown, but no changes in birthday block

then I went to birthday settings, I save it again,
then I clicked on user from birthday block
"JanoS (26) 11/08" but on his profile there is no birthday visible,
on his edit profile page is current date instead his birthday date in date field again.
I changed it, the message I'm in birthdays_save_user() was shown, but no changes in birthday block... :(((

Igor

igorik’s picture

after I edit user birthday, this birthday is shown on his profile (although he was in birthday block before, but on his profile the birthday was not shown).
When I did synchronize, then there are changes in birthday block which reflect last changes.
(but no changes in block after user edit, changes in block are visible after synchronize only)

igorik’s picture

GOOD NEWS!!!

I download and latest birthday module (from a hour or few hours ago), I replaced old module by it,
and till now are every changes shown in birthday block immediately.
so it is great.
Now I can see checkbox hide year and age on user profile (it wasn't there before)

I tried birthday page, there is paging, what is great,
but I can't find any users with birthday, all users what I tried random pages are with birthday, but some of them have zodiac sign...
You can see it on http://somvprahe2.drupal.cz/birthdays
e.g. admin is on the first page, with birthday, but without zodiac sign, and under him is user administrator without birthday but with a zodiac sign.

anyway, it is great that the birthday block is now (I hope) right.
Igor

igorik’s picture

Sorry, this is mistake,this is wrong:
"but I can't find any users with birthday, all users what I tried random pages are with birthday, but some of them have zodiac sign..."

next paragraph is right.

igorik’s picture

hmm,
new users with their birthday are not shown in birthday block anyway (I can see his birthday on his profile)
http://somvprahe2.drupal.cz/user/test5555

and the order in list of birthday in birthday block is a bit weird: (Janos in the middle has 12 08, and after him is test444 witjh 11/08)
the new user test5555 with 11/08 there isn't.

igorik (55) 11/08
Mrxana (52) 11/08
saki (35) 11/08
JanoS (51) 12/08
test444 (33) 11/08
admin (26) 12/08

maartenvg’s picture

I haven't read everything yet (off to bed), i'll do that in the evening. But here are some remarks concerning your last reply.

The newest version lists only people who have accessed the website once after registration. This is because normal users (not admin) can't see the profiles of these people. Showing a link to these non-existing profiles is not a good idea. So that might be why new users aren't showing up directly.

And I believe you have to synchronize once more 'from profile to birthdays'.

maartenvg’s picture

To solve everything for you, we need to reset the entire module to the new version in CVS and reset all settings.

Please do the following things in this order.

- Go to the modules administration and disable the birthdays module
- Go to the uninstall tab and uninstall birthdays module
- Download the newest birthdays.module from CVS: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/birthdays/b...
- Download the newest birthdays.install from CVS: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/birthdays/b...
- Replace the old files with the new ones you just downloaded
- Enable (and thus install) birthdays module.
- Go to birthdays settings
- Select everything you need and save settings.
- Synchronize from Profile module to birthdays module
- Go to user access and check the birthdays access settings
- Everything should work now.

Note: You will stil have people with birthdays of 0000-00-00 and 1900-01-01 and so on, because those were inserted by the users during the buggy previous version. As an administrator you can now go to their profiles and reset those birthdays by means of the "reset birthdays" button. Or you can give them the power to reset their own birthday.

igorik’s picture

Hi!

I am glad that I can confirm that everything about visibility birthdate profile update in birthday block or page is now ok.
Good work!

One small note yet:
I have this order in birthday block or page:

sona (23) 20/08
igorik (31) 09/01
ria (33) 12/01
sisa (32) 24/05
choze (34) 21/12

I think that it is a bit missorder:
II think that choze could be on second place because he will be have the birthday this year yet.

other small thing - checkbox about visibility is now on two places in edit profile pages:
on the edit profil first page (just checkbox, without date field) , and in profile section(tab) where is date field moved (there is date select box and this hiding checkbox)

however, I think that is not bad, if it it will be on the first edit profile, but then together with date select field too. not chceckbox alone.

thanks
Igor
somvprahe.sk

igorik’s picture

you can see it on live somvprahe - http://www.somvprahe.sk
on developing site is old version of your module, I tried it on live site.

Igor

maartenvg’s picture

Hi,

On the checkbox:
I already fixed the check box bug earlier today, but the frontpage tar.gz hasn't been updated yet (updated on 14:00). It's in CVS so you could fix it now if you want to, or you can wait until the frontpage has updated.

On the date listing of Choze:
I'm on it! I can reproduce it, so it's easier for me to find why it's doing it.

maartenvg’s picture

Status: Postponed (maintainer needs more info) » Fixed
StatusFileSize
new2.81 KB

I found what went wrong with the sorting of the birthdays_get_birthdays_by_days() function(s).
MySQL sees strings of numbers as strings, not as integers. This made '1004' (4th of October) come before '406' (6th of April), which is not correct. By forcing it to compare them as integers the comparison goes correctly.

I've attached a patch and committed it to CVS (takes a few hours to show on the project page).

I guess that's that for all the bugs you had encountered. Thanks for going through with trying to get to the bottom of it, we've discovered and fixed many issues that way!
If you encounter any more new issues, please open a new issue. For now I gather this can be tagged as 'fixed'.

I hope we get a few days without any bug reports, so that we can introduce our first stable release! Thanks again!

Anonymous’s picture

Status: Fixed » Closed (fixed)