nextcloud / nextcloud/contacts

TypeError: r.replace is not a function when merging contacts

Open
#5,030 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug feature: contacts regression
Dominant language
JavaScript
Stars
642
Forks
220
Avg merge
14h 39m
Merged PRs (30d)
51

Description

Describe the bug

TypeError: r.replace is not a function when merging contacts

Description:
When attempting to merge two contacts, the merge operation gets stuck with a JavaScript error:
TypeError: r.replace is not a function

This appears in Merging.vue when the code tries to process contact property values that are null or non-string types.

Version: Nextcloud Contacts 8.3.0
Nextcloud: 32.0.3

Steps to reproduce:

  1. Select two contacts to merge
  2. Click merge button
  3. Operation never completes and shows this error in browser console

Suggested fix:
Add null/type checking in the getPropertyValue() method or sanitize values before displaying them in the merge interface.

Steps to reproduce

Steps to reproduce:

Select two contacts to merge
Click merge button
Operation never completes and shows this error in browser console
Expected behavior

Contact should merge

Actual behavior

Contact don't merge

Contact version

No response

Operating system

No response

PHP engine version

None

Web server

None

Database

None

Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Merging.vue and inspect the getPropertyValue() method, focusing on contact values that are null or non-string types. Reproduce the merge with two contacts and verify that the merge completes without the r.replace error and displays contact properties correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.