# Correct page URL but the content belongs to another member

**URL:** <https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290>\
**Category:** Ask the community\
**Tags:** wix-members-area, code, question, wix\
**Created:** [May 17, 2024, 8:30am UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290 "2024-05-17T08:30:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristofer\_Bath](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kristofer\_Bath](https://forum.wixstudio.com/u/Kristofer_Bath)\
**Post date:** [May 17, 2024, 8:30am UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/1 "2024-05-17T08:30:51Z")

</div>

**Question:**  
I have created **custom** dynamic pages for registration, account and profile (with other words I don´t use “Members Area” at all). On a list-page I show all the members with their respective profile photo. When a member clicks on another members photo he shall be relocated to the photo-owners profile page. This works as intended when it comes to the page URL but the content is the clicking members own information. Extremely frustrating because I have really tested “everything”. So please help me solve this matter 😖 I´m sure of that many other custom creators also wanna know the solution for such an important function. Do I have to use their slug or e-mail adress instead of nickname or id?

**Product:**  
Wix Editor

**What are you trying to achieve:**  
I want the photo-clicking member be relocated to the photo-owners profile page which ofcourse shall show the photo-owners information (not the clicking members).

**What have you already tried:**  
Everything I can imagine during 2 years. The most difficult matter I have experienced since I began using Wix and even the experts seem confused because none have given me a working answer.

---

<div class="post-metadata">

**Author:** ![noahlovell](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/noahlovell/32/118920_2.png) [@noahlovell](https://forum.wixstudio.com/u/noahlovell)\
**Post date:** [May 17, 2024, 2:26pm UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/2 "2024-05-17T14:26:15Z")

</div>

Are you using any code on these pages?

Are you able to share some more details about the setup of the project (code being used, dynamic pages vs normal pages etc.) 🙂

---

<div class="post-metadata">

**Author:** ![Kristofer\_Bath](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kristofer\_Bath](https://forum.wixstudio.com/u/Kristofer_Bath)\
**Post date:** [May 17, 2024, 6:24pm UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/3 "2024-05-17T18:24:05Z")

</div>

Yes here is the code for the registration page (not dynamic) but for some reason members backend is not found. The registration process works as intended though:

import { authentication, authorization, badges, currentMember, members } from ‘wix-members-backend’;  
import wixLocation from ‘wix-location’;  
import wixWindow from ‘wix-window’;  
import wixUsers from ‘wix-users’;  
import wixData from ‘wix-data’;

export async function callmember() {  
let options = {  
fieldsets: [‘FULL’]  
}  
const member = await currentMember.getMember(options)  
return member  
}  
let formFactor = wixWindow.formFactor;

```
wixWindow.getBoundingRect()

```

.then( (windowSizeInfo) =\> {  
let windowHeight = windowSizeInfo.window.height; // 565  
let windowWidth = windowSizeInfo.window.width; // 1269  
let documentHeight = windowSizeInfo.document.height; // 780  
let documentWidth = windowSizeInfo.document.width; // 1269  
let scrollX = windowSizeInfo.scroll.x; // 0  
let scrollY = windowSizeInfo.scroll.y; // 120  
});  
export function email\_change(value, valid) {  
let loginEmail = $w(‘#email’).value;  
wixData.query(‘Members’)  
.eq(‘loginEmail’, loginEmail)  
.find()  
.then(res =\> {  
if (res.length === 1) {  
$w(‘#emailRegistered’).show();  
$w(‘#button1’).expand();  
} else {  
{ valid(“E-mail is registered”);  
$w(‘#emailRegistered’).hide();  
$w(‘#emailMessage’).show();  
}  
}  
})  
}  
export function password\_change(event) {  
$w(‘#passwordMessage’).show();  
}  
export function nickname\_change(value, reject) {  
let nickname = $w(‘#nickname’).value;  
wixData.query(‘Members’)  
.eq(‘nickname’, nickname)  
.find()  
.then(res =\> {  
if (res.length === 0) {  
$w(‘#nickTaken’).hide();  
} else {  
{ reject(“Nickname is taken”);  
$w(‘#nickTaken’).show();  
}  
}  
})  
}  
export function myMakeProfilePublicFunction() {  
return currentMember.makeProfilePublic()  
.then((updatedMember) =\> {  
const newPrivacyStatus = updatedMember.privacyStatus;  
return updatedMember;  
})  
.catch((error) =\> {  
console.error(error);  
})  
}  
let genderValue;  
let genderLabel;

$w.onReady(function() {console.log(“Page is ready → CODE-START!!!”);  
console.log("DropDown-Options: ", $w(‘#ddGender’).options);

```
$w('#ddGender').onChange((event)=>{
    //console.log("Selected-DropDown-Index: ", $w('#ddnGender').selectedIndex); 
   // console.log("Gender chosen: "+$w('#ddnGender').options[$w('#ddnGender').selectedIndex].label);

   genderValue = $w('#ddGender').value; console.log("VALUE: ", genderValue);
   genderLabel = $w('#ddGender').options[$w('#ddGender').selectedIndex].label; console.log("Label: ", genderLabel);
});
$w('#ddGender').onChange(()=>{console.log("Gender-Icon chosen: "+$w('#ddGender').value);});
$w('#regButton').onClick(()=>{register()
$w('#regButton').label
$w('#regButton').label = "Logging you in..";  

```

});  
});  
function register() {console.log(“Registration-process started…”);  
if (valuesValid()) {console.log(“All values = VALID!!!”);  
let email = $w(‘#email’).value  
let password = $w(‘#password’).value  
authentication.register(email, password)  
.then((user) =\> {  
const toInsert = {  
“\_id”: user.member.\_id,  
“\_owner”: user.member.\_id,  
“loginEmail”: email,  
“password”: password,  
“firstName”: $w(‘#forename’).value,  
“nickname”: $w(‘#nickname’).value,  
“age”: $w(‘#age’).value,  
“gender”: genderLabel,  
“genderIcon”: genderValue,  
“country”: $w(‘#country’).value,  
“state”: $w(‘#state’).value,  
“language”: $w(‘#language’).value,  
“registerDate”: $w(‘#registerDate’).value,  
“\_createdDate”: $w(‘#createdDate’).value,  
};  
wixData.insert(“Members”, toInsert)  
.then((item) =\> {  
if (wixUsers.currentUser.loggedIn) {  
wixLocation.to(`/members/account/${item._id}`);  
} else {  
let email = $w(‘#email’).value;  
let password = $w(‘#password’).value;  
wixUsers.login(email, password).then(() =\> {  
wixLocation.to(`/members/account/${item._id}`);  
}).catch((err) =\> {  
console.error(err);  
$w(‘#errorMessage’).text = "Couldn’t log you in: " + err  
errorMessage();  
}); console.log(“User is logged in”);  
}  
})  
.catch((err) =\> {console.error(err);  
$w(‘#errorMessage’).text = "Something isn’t right on your end: " + err  
errorMessage()  
});  
})  
} else {console.log(“You have some INVALID values!!!”);  
$w(‘#errorMessage’).text = “Something isn’t right on your end: There’s an Invalid or Missing Property”  
errorMessage();  
}  
}  
function errorMessage() {  
$w(‘#errorMessage’).show()  
$w(‘#errorMessage’).expand()  
$w(‘#regButton’).enable()  
$w(‘#regButton’).label = ‘Register’  
setTimeout(() =\> {  
$w(‘#errorMessage’).hide(‘fade’)  
}, 10000)  
setTimeout(() =\> {  
}, 10500)  
}  
function valuesValid() {console.log(“VALIDATION running…”);  
return $w(‘#email’).valid &&  
$w(‘#password’).valid &&  
$w(‘#forename’).valid &&  
$w(‘#age’).valid &&  
$w(‘#ddGender’).valid &&  
$w(‘#orientation’).valid &&  
$w(‘#country’).valid &&  
$w(‘#language’).valid &&  
$w(‘#nickname’).valid &&  
$w(‘#state’).valid &&  
$w(‘#registerDate’).valid &&  
$w(‘#createdDate’).valid;  
}

**And here is the code for the dynamic profile page:**

import { currentMember } from ‘wix-members-frontend’;  
import wixLocation from ‘wix-location’  
import wixWindow from ‘wix-window’;  
import wixUsers from ‘wix-users’;  
import wixData from ‘wix-data’;

let \_owner = wixUsers.currentUser;  
let isLoggedIn = \_owner.loggedIn;  
let userId = \_owner.id;

let dataset = $w(“#dataset7”);

wixWindow.getBoundingRect()  
.then( (windowSizeInfo) =\> {  
let windowHeight = windowSizeInfo.window.height; // 565  
let windowWidth = windowSizeInfo.window.width; // 1269  
let documentHeight = windowSizeInfo.document.height; // 780  
let documentWidth = windowSizeInfo.document.width; // 1269  
let scrollX = windowSizeInfo.scroll.x; // 0  
let scrollY = windowSizeInfo.scroll.y; // 120  
});  
$w.onReady(function () {

$w.onReady(async () =\> {  
let user = wixUsers.currentUser;  
let userId = user.id;

```
  return wixData.query("Members")
	.eq("_id", userId)
	.find()
	.then((results) => {
		if (results.items.length === 0) {
			console.log("Visitor isn´t owner");
	} else {
			$w("#addOrDelete").expand();
    $w("#publicButton").expand();
    $w("#text452").expand();
 }

```

})  
})  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
$w(“#headnick”).text = (item.nickname);  
$w(“#nickname”).text = (item.nickname);  
$w(“#gender”).text = (item.gender);  
$w(“#age”).text = (item.age);  
$w(“#country”).text = (item.country);  
$w(“#state”).text = (item.state);  
})  
})  
})  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.picture === undefined) {  
console.log(“No picture”);  
} else {  
$w(“#image83”).src = (item.picture);  
}  
});  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.description === undefined) {  
console.log(“No description”);  
} else {  
$w(“#textBox2”).value = (item.description);  
}  
});  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink1 === undefined) {  
$w(“#title1”).text = “Image 1”;  
$w(“#clearback1”).expand();  
$w(“#image1”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image1”).src = (item.photoLink1);  
$w(“#title1”).text = (item.photoTitle1);  
console.log(“image added”);  
}  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink2 === undefined) {  
$w(“#title2”).text = “Image 2”;  
$w(“#clearback2”).expand();  
$w(“#image2”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image2”).src = (item.photoLink2);  
$w(“#title2”).text = (item.photoTitle2);  
console.log(“image added”);  
}  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink3 === undefined) {  
$w(“#title3”).text = “Image 3”;  
$w(“#clearback3”).expand();  
$w(“#image3”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image3”).src = (item.photoLink3);  
$w(“#title3”).text = (item.photoTitle3);  
console.log(“image added”);  
}  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink4 === undefined) {  
$w(“#title4”).text = “Image 4”;  
$w(“#clearback4”).expand();  
$w(“#image4”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image4”).src = (item.photoLink4);  
$w(“#title4”).text = (item.photoTitle4);  
console.log(“image added”);  
}  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink5 === undefined) {  
$w(“#title5”).text = “Image 5”;  
$w(“#clearback5”).expand();  
$w(“#image5”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image5”).src = (item.photoLink5);  
$w(“#title5”).text = (item.photoTitle5);  
console.log(“image added”);  
}  
});  
$w.onReady(async () =\> {  
wixData.get(“Members”, \_owner.id)  
.then((item) =\> {  
if (item.photoLink6 === undefined) {  
$w(“#title6”).text = “Image 6”;  
$w(“#clearback6”).expand();  
$w(“#image6”).collapse();  
console.log(“no image”);  
} else {  
$w(“#image6”).src = (item.photoLink6);  
$w(“#title6”).text = (item.photoTitle6);  
console.log(“image added”);  
}  
});  
$w(‘#next1’).onClick(() =\> {  
$w(“#titlegroup2”).expand();  
$w(“#titlegroup1”).collapse();  
});  
$w(‘#back1’).onClick(() =\> {  
$w(‘#titlegroup6’).expand();  
$w(‘#titlegroup1’).collapse();  
});  
$w(‘#next2’).onClick(() =\> {  
$w(“#titlegroup3”).expand();  
$w(“#titlegroup2”).collapse();  
});  
$w(‘#back2’).onClick(() =\> {  
$w(‘#titlegroup1’).expand();  
$w(‘#titlegroup2’).collapse();  
});  
$w(‘#next3’).onClick(() =\> {  
$w(“#titlegroup4”).expand();  
$w(“#titlegroup3”).collapse();  
});  
$w(‘#back3’).onClick(() =\> {  
$w(“#titlegroup2”).expand();  
$w(“#titlegroup3”).collapse();  
});  
$w(‘#next4’).onClick(() =\> {  
$w(“#titlegroup5”).expand();  
$w(“#titlegroup4”).collapse();  
});  
$w(‘#back4’).onClick(() =\> {  
$w(“#titlegroup3”).expand();  
$w(“#titlegroup4”).collapse();  
});  
$w(‘#next5’).onClick(() =\> {  
$w(“#titlegroup6”).expand();  
$w(“#titlegroup5”).collapse();  
});  
$w(‘#back5’).onClick(() =\> {  
$w(“#titlegroup4”).expand();  
$w(“#titlegroup5”).collapse();  
});  
$w(‘#next6’).onClick(() =\> {  
$w(“#titlegroup1”).expand();  
$w(“#titlegroup6”).collapse();  
});  
$w(‘#back6’).onClick(() =\> {  
$w(“#titlegroup5”).expand();  
$w(“#titlegroup6”).collapse();  
})  
})  
})  
})  
})  
})  
})  
export function publicButton\_click(event) {  
$w.onReady( () =\> {  
dataset.onReady(async() =\> {  
currentMember.makeProfilePublic()  
.then((updatedMember) =\> {  
const newPrivacyStatus = updatedMember.privacyStatus;  
console.log(‘Privacy status was changed to’, newPrivacyStatus);  
})  
.catch((error) =\> {  
console.error(error);  
});  
})  
})  
}  
export function controlButton1\_click(event) {  
$w(‘#image68’).show();  
$w(‘#image69’).show();  
$w(‘#button5’).show();  
$w(‘#button8’).show();  
$w(‘#button9’).show();  
$w(‘#logout’).show();  
$w(‘#button12’).show();  
$w(‘#button13’).show();  
$w(‘#controlButton2’).show();  
$w(‘#controlButton1’).hide();  
}  
export function controlButton2\_click(event) {  
$w(‘#image68’).hide();  
$w(‘#image69’).hide();  
$w(‘#button5’).hide();  
$w(‘#button8’).hide();  
$w(‘#button9’).hide();  
$w(‘#logout’).hide();  
$w(‘#button12’).hide();  
$w(‘#button13’).hide();  
$w(‘#controlButton2’).hide();  
$w(‘#controlButton1’).show();  
}  
$w(‘#button4’).onClick(() =\> {  
wixLocation.to(‘/login’)  
})

**Finally the code for a page where a member can click on other members profile photo to be relocated to that members profile page:**

import wixLocation from ‘wix-location’;  
import wixStorage from ‘wix-storage’;  
import FilterWords from ‘bad-words’;  
import wixWindow from ‘wix-window’;  
import wixUsers from ‘wix-users’;  
import wixData from ‘wix-data’;  
import numeral from ‘numeral’

let formFactor = wixWindow.formFactor;

$w.onReady(function () {

```
$w.onReady(async () => {
    wixData.get("Members", wixUsers.currentUser.id)
        .then((item) => {
        if (item.picture === undefined) {
            console.log("no image");
        } else {
            $w("#picture").src = (item.picture);
            $w("#nopicture").collapse();
            $w('#picture').expand();

```

}  
})  
})  
})  
const slideOptions = {  
“direction”: “bottom”, “duration”: 500,  
}  
export function button1\_click(event) {  
$w(“#image66”).hide();  
$w(“#videoPlayer1”).show();  
setTimeout(() =\> {  
$w(“#button1”).hide(“slide”, slideOptions);  
}, 100);  
setTimeout(() =\> {  
$w(“#videoPlayer1”).play();  
}, 100);  
}  
export function image47\_mouseIn(event) {  
$w(“#button1”).show();  
setTimeout(() =\> {  
$w(“#image47”).hide();  
$w(“#image67”).show()  
$w(“#image66”).show();  
}, 800);  
}  
import { session } from ‘wix-storage’;  
let filterWords = new FilterWords();

let bounceCenter = {  
“duration”: 500,  
“direction”: “center”,  
“intensity”: “medium”,  
};  
function login() {  
wixUsers.promptLogin({ “mode”: “login” })  
}  
$w.onReady(() =\> {  
filterComments()  
$w(“#logout”).onClick(logoutAndRedirect);  
});  
function logoutAndRedirect(event) {  
Promise.all([wixLocation.to(‘/login’), wixUsers.logout()]);  
}  
function filterComments() {  
$w(‘#dataset4’).onReady(() =\> {  
$w(‘#dataset4’).setFilter(  
wixData.filter()  
.eq(“pageId”, $w(“#dataset1”).getCurrentItem().\_id)  
).then(() =\> {  
let currentItem = $w(“#dataset1”).getCurrentItem();  
let totalCount = $w(“#dataset4”).getTotalCount();  
$w(‘#text344’).text = totalCount.toString() + " ratings and comments"  
wixData.aggregate(“Inclusivecomments”)  
.filter(wixData.filter().eq(“pageId”, $w(‘#dataset1’).getCurrentItem().\_id))  
.sum(“rating”, “rating”)  
.run()  
.then((results) =\> {  
if (results.items.length \< 1) {  
$w(‘#ratingsDisplay’).rating = 0  
} else {  
let sumAmount = results.items[0].rating  
let rating = Number(sumAmount / totalCount).toFixed(1)  
$w(‘#ratingsDisplay’).rating = Number(rating)  
}  
});  
likeFunctionComment()  
addComment()  
deleteComment()  
})  
})  
}  
function deleteComment() {  
$w(‘#repeater1’).forEachItem(($item, itemData, index) =\> {  
console.log(itemData.currentUserId + " === " + wixUsers.currentUser.id)  
if (itemData.currentUserId === wixUsers.currentUser.id) {  
$item(“#deleteComment”).show()  
} else {  
$item(“#deleteComment”).hide()  
}  
})  
$w(‘#deleteComment’).onClick((event) =\> {  
let $item = $w.at(event.context)  
let currentItem = $item(“#dataset4”).getCurrentItem()  
$item(‘#deleteComment’).disable()  
$item(‘#deleteComment’).label = “Deleting…”  
wixData.remove(“Inclusivecomments”, currentItem.\_id)  
.then(() =\> {  
$w(‘#dataset4’).refresh()  
setTimeout(() =\> {  
let totalCount = $w(“#dataset4”).getTotalCount();  
$w(‘#text344’).text = totalCount.toString() + " ratings and comments"  
setTimeout(() =\> {  
wixData.aggregate(“Inclusivecomments”)  
.filter(wixData.filter().eq(“pageId”, $w(‘#dataset1’).getCurrentItem().\_id))  
.sum(“rating”, “rating”)  
.run()  
.then((results) =\> {  
if (results.items.length \< 1) {  
$w(‘#ratingsDisplay’).rating = 0  
} else {  
let sumAmount = results.items[0].rating  
let rating = Number(sumAmount / totalCount).toFixed(1)  
$w(‘#ratingsDisplay’).rating = Number(rating)  
}  
});  
}, 2500)  
}, 2000)  
})  
})  
}  
function addComment() {  
$w(‘#button3’).onClick(() =\> {  
$w(“#image63”).hide();  
$w(“#image62”).show();  
$w(“#audioPlayer”).play();  
setTimeout(() =\> {  
$w(“#image62”).hide();  
$w(“#image63”).show();  
}, 150);  
let value = $w(‘#textBox2’).value.replace(/\s+/g, ’ ‘)  
if (value === ’ ’ || value === ‘’) {  
$w(’#button3’).enable()  
$w(‘#infotext’).text = ‘Please enter a written comment’  
$w(‘#infotext’).show()  
setTimeout(() =\> {  
$w(‘#infotext’).hide()  
}, 5000)  
} else {  
if ($w(‘#ratingsInput’).valid) {  
insertComment()  
} else {  
$w(‘#infotext’).text = ‘Please first add a star rating for this video!’  
$w(‘#infotext’).show()  
setTimeout(() =\> {  
$w(‘#infotext’).hide()  
}, 9000)  
}  
}  
})  
}  
function likeFunctionComment() {  
let likes\_array = ;  
$w(‘#repeater1’).onItemReady(($item, itemData, index) =\> {  
let likes = itemData.likes;  
if (likes) {  
let parsed\_likes = JSON.parse(likes);  
$item(“#likes”).text = parsed\_likes.length.toLocaleString();  
} else {  
$item(“#likes”).text = (0).toLocaleString();  
}  
if (itemData.likes) {  
if (itemData.likes.includes(wixUsers.currentUser.id)) {  
$item(“#emptyHeart”).hide();  
$item(“#fullHeart”).show();  
}  
}  
$item(“#emptyHeart”).onClick((event) =\> {  
if (wixUsers.currentUser.loggedIn) {  
let $itemm = $w.at(event.context);  
toggleHeart($itemm, itemData)  
} else {  
let $item = $w.at(event.context);  
$item(‘#emptyHeart’).hide()  
$item(‘#emptyHeart’).show(‘bounce’, bounceCenter)  
setTimeout(() =\> {  
login()  
}, 500)  
}  
})  
$item(“#fullHeart”).onClick((event) =\> {  
let $itemm = $w.at(event.context);  
toggleHeart($itemm, itemData);  
});  
})  
async function toggleHeart(itemm, itemData) {  
let emptyHeart = itemm(“#emptyHeart”);  
let fullHeart = itemm(“#fullHeart”);  
let likes = itemm(“#likes”);  
if (fullHeart.hidden) {  
fullHeart.show(‘bounce’, bounceCenter);  
emptyHeart.hide()  
await saveHeart(itemData);  
likes.text = (Number(likes.text) + 1).toLocaleString();  
} else {  
fullHeart.hide();  
emptyHeart.show(‘bounce’, bounceCenter);  
await deleteHeart(itemData);  
likes.text = (Number(likes.text) - 1).toLocaleString();  
}  
}  
async function saveHeart(itemData) {  
if (!itemData.likes) {  
likes\_array.push({  
“\_id”: wixUsers.currentUser.id  
})  
itemData.likes = await JSON.stringify(likes\_array);  
wixData.update(“Inclusivecomments”, itemData)  
.then((results) =\> {});  
} else {  
likes\_array = JSON.parse(itemData.likes);  
likes\_array.push({  
“\_id”: wixUsers.currentUser.id  
})  
itemData.likes = await JSON.stringify(likes\_array);  
wixData.update(“Inclusivecomments”, itemData)  
.then((results) =\> {});  
}  
}  
async function deleteHeart(itemData) {  
if (itemData.likes) {  
let parsed\_likes = JSON.parse(itemData.likes);  
let deleted\_likes = parsed\_likes.filter(function (obj) {  
return obj.\_id !== wixUsers.currentUser.id;  
});  
itemData.likes = await JSON.stringify(deleted\_likes);  
wixData.update(“Inclusivecomments”, itemData)  
.then((results) =\> {});  
}  
}  
}  
function insertComment() {  
let currentItem = $w(‘#dataset1’).getCurrentItem()  
wixData.insert(‘Inclusivecomments’, {  
‘comment’: filterWords.clean($w(‘#textBox2’).value),  
‘currentUserId’: wixUsers.currentUser.id,  
‘memberReference’: wixUsers.currentUser.id,  
‘pageReference’: currentItem.\_id,  
‘pageId’: currentItem.\_id,  
‘rating’: $w(‘#ratingsInput’).value  
})  
.catch((error) =\> {  
$w(‘#button3’).enable()  
$w(‘#infotext’).text = “Something isn’t right. Error: " + error  
$w(‘#infotext’).expand()  
setTimeout(() =\> {  
$w(‘#infotext’).text = “Comment isn’t available. The comment was deleted or was taken down”  
$w(‘#infotext’).collapse()  
}, 7500)  
})  
.then(() =\> {  
$w(‘#textBox2’).value = ‘’  
$w(‘#button3’).enable()  
$w(‘#dataset4’).refresh()  
.then(() =\> {  
let totalCount = $w(”#dataset4").getTotalCount();  
$w(‘#text344’).text = totalCount.toString() + " ratings and comments"  
wixData.aggregate(“Inclusivecomments”)  
.filter(wixData.filter().eq(“pageId”, $w(‘#dataset1’).getCurrentItem().\_id))  
.sum(“rating”, “rating”)  
.run()  
.then((results) =\> {  
if (results.items.length \< 1) {  
$w(‘#ratingsDisplay’).rating = 0  
} else {  
let sumAmount = results.items[0].rating  
let rating = Number(sumAmount / totalCount).toFixed(1)  
$w(‘#ratingsDisplay’).rating = Number(rating)  
setTimeout(() =\> {  
$w(‘#ratingsInput’).resetValidityIndication();  
}, 100)  
$w(‘#dataset4’).refresh()  
}  
});  
deleteComment()  
})  
})  
}  
export function controlButton1\_click(event) {  
$w(‘#image68’).show();  
$w(‘#image69’).show();  
$w(‘#button5’).show();  
$w(‘#button8’).show();  
$w(‘#button9’).show();  
$w(‘#logout’).show();  
$w(‘#button12’).show();  
$w(‘#button13’).show();  
$w(‘#controlButton2’).show();  
$w(‘#controlButton1’).hide();  
$w(‘#mobileMenu1’).hide();  
$w(‘#group25’).hide();  
}  
export function controlButton2\_click(event) {  
$w(‘#image68’).hide();  
$w(‘#image69’).hide();  
$w(‘#button5’).hide();  
$w(‘#button8’).hide();  
$w(‘#button9’).hide();  
$w(‘#logout’).hide();  
$w(‘#button12’).hide();  
$w(‘#button13’).hide();  
$w(‘#controlButton2’).hide();  
$w(‘#controlButton1’).show();  
$w(‘#mobileMenu1’).show();  
$w(‘#group25’).show();  
}  
$w(‘#logout’).onClick(() =\> {  
wixLocation.to(‘/login’)  
})

---

<div class="post-metadata">

**Author:** ![Kristofer\_Bath](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kristofer\_Bath](https://forum.wixstudio.com/u/Kristofer_Bath)\
**Post date:** [May 19, 2024, 5:14pm UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/4 "2024-05-19T17:14:18Z")

</div>

But I can describe the problem in a far more simple way. I created an item list page with a repeater. Then connected the repeater with my “Members” collection where I have all info about my members. I then connected the image with a “Picture” field and linked it directly to the profile pages, totally without any code. The result is that the clicking member is relocated to the photo-owners profile page (correct URL) but the content shows the clicking members own information. Frustrating to say the least so can someone please explain why and how I can get **the photo-owners** information?

I believe that the code isn´t the problem because in this case there is no code at all but otherwise it can depend on that the correct code is missing. Remember that I use fully customized pages without the “Members Area” app.

---

<div class="post-metadata">

**Author:** ![codequeen](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/codequeen/32/88960_2.png) [@codequeen](https://forum.wixstudio.com/u/codequeen)\
**Post date:** [May 20, 2024, 1:01am UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/5 "2024-05-20T01:01:44Z")

</div>

Sounds like a permission issue.

Is your database set to Read Author Only? Because that means only the person that created the data can read the data, therefore they cannot view anyone else’s info on that database.

---

<div class="post-metadata">

**Author:** ![Kristofer\_Bath](https://avatars.discourse-cdn.com/v4/letter/k/8797f3/32.png) [@Kristofer\_Bath](https://forum.wixstudio.com/u/Kristofer_Bath)\
**Post date:** [May 20, 2024, 8:24am UTC](https://forum.wixstudio.com/t/correct-page-url-but-the-content-belongs-to-another-member/59290/6 "2024-05-20T08:24:09Z")

</div>

Probably not because all “Page permissions” are set to “Members only” and both the photo-clicking guy and the owner of the photo and profile page is a member. The collections are set to “Anyone” or “Site member” so the only restriction I have is to register for a membership.
