FriendsOfFlarum/socialprofile

[!!!] A bug that can cause users to "suicide".

Closed this issue · 2 comments

Error recurrence: when adding a new profile, if the first one is left blank and the second one is filled with information, the user will disappear instantly after clicking Save. Although the user's information still exists in the database, the user's personal data will no longer be loaded on the forum, and only the discussion once published by the user can be browsed.

https://i.imgur.com/v7aNxDk.png

Thanks for the report! I can confirm the issue.

The issue is a javascript error happening here. button is null and the code crashes

if (button.title !== '' && button.icon !== '' && button.url !== '') {

The origin of the null value is probably this loop that serializes the data prior to saving. We should probably just create a new object for the save state, and not add any button that doesn't have a title. What's odd is that the value shouldn't be null, it should just be an object whose key values will be Stream objects so I'm not sure how it serializes as null.

this.buttons.forEach((button, index) => {
if (button.title() !== '') {
buttons[index] = {};
buttons[index].title = button.title();
buttons[index].url = button.url();
buttons[index].icon = button.icon();
buttons[index].favicon = button.favicon();
}
});

Thank you for your attention. 👍
Hope for early repair.