Maps: Open the contact directly from Maps does not work

Created on 30 Aug 2019  路  17Comments  路  Source: nextcloud/maps

When clicking on a contact opens the contact-Link in a new tab, but for me an error occurs:
"couldn't find the contact"

I think this happens because the link that is generated from the maps app looks like this:
https://domain.com/index.php/apps/contacts/All%20contacts/5c944694-8055-4cdd-ace0-798076d000a3~contacts
But my address-book isn't called "contacts". it is called "test" (because I originally named it that way).

So the correct link would be:
https://domain.com/index.php/apps/contacts/All%20contacts/5c944694-8055-4cdd-ace0-798076d000a3~test

I think this error could get fixed, if the maps-app would save the name of the addressbook, where the contact came from while fetching them and just produces the right link.

Thank you for your great work!

bug 馃懃 contacts

Most helpful comment

Would that help if I create a direct link to a contact?
Like we do with shorts links on nextcloud https://domain.com/c/addressbook/UID

All 17 comments

Also while investigating that, I found out, that the link seems to change depending on the language, that you have chosen inside the nextcloud user-settings.

The maps app always produces links like that: (not respecting the language-settings)
https://domain.com/index.php/apps/contacts/All%20contacts/5c944694-8055-4cdd-ace0-798076d000a3~contacts

But e.g. if I switch the language to german, the correct link would look like that:
https://domain.com/index.php/apps/contacts/Alle%20Kontakte/5c944694-8055-4cdd-ace0-798076d000a3~contacts

Yep, that's why I postponed fixing that.

okay 馃憤

It might well be, that the addressbook is disabled in the contacts app, then you get the same error even, if the link would be correct.

Would that help if I create a direct link to a contact?
Like we do with shorts links on nextcloud https://domain.com/c/addressbook/UID

@skjnldsv what time would it need before such a short link is available? How are links to contacts generated on other places?

@tacruc well, I still haven't implemented it, but I'm sure we can figure something out :)

@skjnldsv I was woundering where it would be implemented and if it would just be a solution for NC18 and later? Or if it is in the contacts app and might be a solution the next month.

Contacts :)

@skjnldsv Do you know, where and how
image
the link of the info button is generated?
I couldn't find it in the server code.

In the contacts app :)

So apparently I cannot create simple routes like that.
So it would be something like
/apps/contacts/get/addressbook/uid

Thats fine

So it would be something like
/apps/contacts/get/addressbook/uid

@skjnldsv It would be perfect!

Also while investigating that, I found out, that the link seems to change depending on the language, that you have chosen inside the nextcloud user-settings.

The maps app always produces links like that: (not respecting the language-settings)
https://domain.com/index.php/apps/contacts/All%20contacts/5c944694-8055-4cdd-ace0-798076d000a3~contacts

But e.g. if I switch the language to german, the correct link would look like that:
https://domain.com/index.php/apps/contacts/Alle%20Kontakte/5c944694-8055-4cdd-ace0-798076d000a3~contacts

I experienced the same issue. In French the link should be something like
https://domain.com/index.php/apps/contacts/Tous%20les%20contacts/5c944694-8055-4cdd-ace0-798076d000a3~contacts
I looked the code and I am not sure what the problem is since the code generating the URL look like being localized.
The only thing is that it calls t('contacts', 'All contacts') instead of t('maps', 'All contacts').

The only thing is that it calls t('contacts', 'All contacts') instead of t('maps', 'All contacts').

Yes, it's because we want to use the same translations than what contacts is using.
Btw @eneiluj & @tacruc , direct contact link: https://github.com/nextcloud/server/blob/45b3ddd882e395af17cc9ffb7476b8a124d903ee/apps/dav/lib/Search/ContactsSearchProvider.php#L188-L192

The only thing is that it calls t('contacts', 'All contacts') instead of t('maps', 'All contacts').

Yes, it's because we want to use the same translations than what contacts is using.
Btw @eneiluj & @tacruc , direct contact link: https://github.com/nextcloud/server/blob/45b3ddd882e395af17cc9ffb7476b8a124d903ee/apps/dav/lib/Search/ContactsSearchProvider.php#L188-L192

Yes, I figured that and it makes lots of sense. It looks like all the others translations in the 'map' domain are working well and this one in the 'contacts' domain doesn't so it could be related.
In addition, I found that a translation for 'All contacts' is available in apps/maps/l10n/fr.js and apps/maps/l10n/fr.json.
I was tempted to test it but I don't have much time to setup a nextcloud development instance.

I am not familiar with this localization system, but I know that with gettext you need both a locale directory where the message catalog are stored and a domain ( like 'maps' or 'contact') to find the catalog were to lookup the message.
Maybe the maps program is just not able to locate the 'contacts' catalog

Was this page helpful?
0 / 5 - 0 ratings