calendarplus icon indicating copy to clipboard operation
calendarplus copied to clipboard

Duplicate birthday calendar

Open Spheerys opened this issue 10 years ago • 11 comments

Hi,

I have a duplicate suscribed birthday calendar but I'm not sure if the problem comes from calendarplus, Thunderbird SoGo Connector or SolCalendar (my android app) !

I have all day more and more birthday suscribed calendar, and I don't know why !

calendarplus

From which component the issue comes from ? How can I delete them on one time ?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28563971-duplicate-birthday-calendar?utm_campaign=plugin&utm_content=tracker%2F19394737&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F19394737&utm_medium=issues&utm_source=github).

Spheerys avatar Nov 24 '15 10:11 Spheerys

Have the same issue.

Since I don't have any of those apps listed, it's safe to assume it comes from Calendar+.

One more "birthdays" subscription is added every time I access/refresh the page.

Webbeh avatar Nov 28 '15 19:11 Webbeh

Uncommenting those lines :

 if(\OC::$server->getAppManager()->isEnabledForUser('contactsplus')) {                        

  $appinfo =\OCP\App::getAppVersion('contactsplus');
  if (version_compare($appinfo, '1.0.6', '>=')) {
   $calId = $this->calendarController->checkBirthdayCalendarByUri('bdaycpltocal_'.$this->userId);
  }
 }

in pagecontroller.php prevented the Birthdays from duplicating.

I guess, by looking at checkBirthdayCalendarByUri, that $this->userId may not always return the same thing ? Or that bdaycpltocal_<userId> isn't saved correctly...

(I have ContactsPlus installed)

Webbeh avatar Nov 28 '15 19:11 Webbeh

These lines are not commented in my pagecontroller.php file. Maybe I should comment them ?

And after fix the problem, how did you remove the duplicate birthday calendars ? One by one or with a SQL query ?

Spheerys avatar Dec 02 '15 09:12 Spheerys

@Spheerys: I would recommend to remove them one by one via OC webclient to be sure that there are no side effects if you delete them directly an the DB-level.

Yea, I know, you've got a lot of entries - but just to be sure ;)

JBScoutBerlin avatar Dec 02 '15 10:12 JBScoutBerlin

I commented out the lines myself.

After the fix, I deleted all but one of the birthdays.

Be aware that after commenting the text out, if you delete every subscription you have, it won't reappear. So either delete all but one of the birthdays (by hand/with sql), or delet everything, uncomment the lines, regenerate one, recomment the lines.

I deleted by hand, only had a few ones.

Webbeh avatar Dec 02 '15 15:12 Webbeh

Deleting them in the database, if they are all empty, leaves no side effect other than described in the previous message.

Webbeh avatar Dec 02 '15 15:12 Webbeh

I finally delete them manually ^^

Inside the pagecontroller.php file, I just comment one line this way :

 if(\OC::$server->getAppManager()->isEnabledForUser('contactsplus')) {                        

  $appinfo =\OCP\App::getAppVersion('contactsplus');
  if (version_compare($appinfo, '1.0.6', '>=')) {
   #$calId = $this->calendarController->checkBirthdayCalendarByUri('bdaycpltocal_'.$this->userId);
  }
 }

My problem is solved (until next upgrade) :)

Spheerys avatar Dec 05 '15 09:12 Spheerys

Since the bug is not resolved, you should not close it.

Webbeh avatar Dec 05 '15 10:12 Webbeh

You're right, I have reopen it :)

Spheerys avatar Dec 18 '15 20:12 Spheerys

Hello. The problem is related to upper case characters in usernames.

There's some place where code makes strtolower when creating the URI for the calendar link.

The app checks for the existence of birthday's calendar by comparing the actual UserName with the calendar's URI bdaycpltocal_'.$aCalendar['userid'] but unfortunately $aCalendar['userid'] is always lower case. So they will never match if you use any upper case character in your usernames and then a new calendar will be created every time you get into the app.

A pity I'm not able to fix it. Just looking for strtolower strings but no success for now even commenting all appearings out. :-/ I'll write if I get any new hint.

Up to now I've disabled the creation of the birthday calendar at public function checkBirthdayCalendarByUri($uri) in calendarcontroller.php.

(Meanwhile, I keep struggling with another issue)

Regards.

sggalan avatar Mar 23 '16 16:03 sggalan

I too have this problem, with an uppercase username in OC.

Zettt avatar Apr 06 '16 14:04 Zettt