Open uniphonic opened 2 years ago
Yes, it should work. I've also just run through the flow in my test multisite install successfully. Did you maybe receive an e-mail (something like "Your Site is Experiencing a Technical Issue") with a more concrete error message?
Thanks for the reply. For me, works from the main parent site, but not from a child site. I haven't received the error email, so I'm going to try activating an SMTP plugin to see if that allows me to receive it.
Hm, I've tried all sorts of combinations between main, child, and non-multisite but haven't been able to generate an error. Do you have access to the server's error log? Maybe something could be found there.
I turned on debugging, and got the error:
Fatal error: Uncaught Error: Call to undefined function Friends_Mf2\mb_convert_encoding() in /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php:100 Stack trace: #0 /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php(369): Friends_Mf2\unicodeToHtmlEntities('<!DOCTYPE html>...') #1 /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php(45): Friends_Mf2\Parser->__construct('<!DOCTYPE html>...', 'https://acceler...') #2 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-feed.php(844): Friends_Mf2\parse('<!DOCTYPE html>...', 'https://acceler...') #3 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-feed.php(666): Friends_Feed->discover_link_rel_feeds('<!DOCTYPE html>...', 'https://acceler...', Object(Requests_Utility_CaseInsensitiveDictionary)) #4 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-admin.php(1302): Friends_Feed->discover_available_feeds('https://acceler...') #5 /home/userfolder/public_h in /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php on line 100 There has been a critical error on this website.
It appears that something that might be related is that the site that is getting the error is a multisite instance that is set up for subdirectories, rather than subdomains. I just tried the Friends plugin on a different multisite instance that was set up for subdomains, and it worked fine. The only place where I've found that it doesn't work is a sub-site on a multisite instance that is set up for subdirectories.
I hope that is helpful for replicating the issue?
Thanks!
Thank you, that error message was helpful! I've committed a fix (https://github.com/akirk/friends/commit/e7d940467a96f41730678aff348553a7a365f3d2) and released version 1.8.4. Could you try if it fixes the fatal error?
Thanks! I updated the single file, but I'm still getting an error which looks very similar:
Fatal error: Uncaught Error: Call to undefined function mb_convert_encoding() in /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php:100 Stack trace: #0 /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php(369): Friends_Mf2\unicodeToHtmlEntities('<!DOCTYPE html>...') #1 /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php(45): Friends_Mf2\Parser->__construct('<!DOCTYPE html>...', 'https://acceler...') #2 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-feed.php(844): Friends_Mf2\parse('<!DOCTYPE html>...', 'https://acceler...') #3 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-feed.php(666): Friends_Feed->discover_link_rel_feeds('<!DOCTYPE html>...', 'https://acceler...', Object(Requests_Utility_CaseInsensitiveDictionary)) #4 /home/userfolder/public_html/wp-content/plugins/friends/includes/class-friends-admin.php(1302): Friends_Feed->discover_available_feeds('https://acceler...') #5 /home/userfolder/public_html/wp-conte in /home/userfolder/public_html/wp-content/plugins/friends/libs/Mf2/Parser.php on line 100 There has been a critical error on this website.
If you want to replicate the issue, you might try it on a multisite instance that is set up for subdirectories rather than subdomains?
Thank you!
It looks like your PHP doesn't have support for mb_* functions. I'll check if I can work around that but it's not a quick fix.
OK, thanks! I'm on PHP 7.4, but I could could move to 8.0 or 8.1 if that would be preferred?
Update: I just tried both PHP 8.0 and 8.1, and they both threw errors, so It seems that 7.4 is the version I should stick with. But please give a recommendation if you think I should try something different?
Thanks!
I just tried enabling the PHP extension "mbstring", and it seems to work now! Thanks! Except that I'm still getting a notice message (twice for some reason):
Notice: Undefined index: autoselect in /home/userfolder/public_html/wp-content/plugins/friends/templates/admin/select-feeds.php on line 118
Notice: Undefined index: autoselect in /home/userfolder/public_html/wp-content/plugins/friends/templates/admin/select-feeds.php on line 118
is this expected? Thanks!
Another issue I've run into, is that if two separate sites in a multisite network both try to add the same "Friend" to their site as a subscription feed, it gives an error saying "Error: This username is already registered. Please choose another one.", even though the second user who is trying to add this site doesn't show them as a "friend" or a "user" yet at all.
If I change the site name slightly, it will let me successfully add it, but it seems that it must not conflict with any other friend/user names given by other users? This seems problematic in a multisite context...
If, for instance, 20 different users each with their own sub-site in a multisite install, all want to subscribe to the same site, do they each really have to come up with a unique name for the feed of the same site, so that there are 20 different friend/user names for the same site subscription? It seems like there should be some way to use the same site name for subscriptions across multiple users?
Thanks!
Notice: Undefined index: autoselect in /home/userfolder/public_html/wp-content/plugins/friends/templates/admin/select-feeds.php on line 118
is this expected?
This is among the PHP notices that I fixed for 1.8.4, could you check if those are still there after you upgraded the plugin to that version?
Another issue I've run into, is that if two separate sites in a multisite network both try to add the same "Friend" to their site as a subscription feed, it gives an error saying "Error: This username is already registered. Please choose another one.", even though the second user who is trying to add this site doesn't show them as a "friend" or a "user" yet at all. If I change the site name slightly, it will let me successfully add it, but it seems that it must not conflict with any other friend/user names given by other users? This seems problematic in a multisite context...
You are right! I think this is a regression, I need to check why it is not working (there already is some special handling for this). It should not be a problem for two sites to share the same "external" user. I'll post here again when I have checked why this is happening. Likely this will be fixed in the next version.
Awesome! Thanks for the quick fix! That seems to have solved both issues.
One remaining issue I'm seeing, is that I've accepted a friend request, but the notification seems to be persisting for some reason... seen that one before?
Hm, could you check the role of the user on the particular site? The notification is not stored but generated from things like friend requests.
@akirk , the user who is accepting the friend request has a role of "Administrator". The user who sent the friend request has a role of "none" in the site, even after the friend request is accepted. Does that help diagnose? I'm assuming the user who sent the friend request should have their elevated to "Friend" instead of "none", in their friends site?
It sounds to me that the roles (Friend, Friend Request etc) have not been created on the second site. Could you check if these are available at all (for example when creating a new user you can choose its role)? Maybe try to deactivate the Friends plugin and reactivate it, it should create the roles.
@akirk , it appears you are correct. There is no "Friend" role for this site.
Shouldn't the role be automatically be added when the plugin is installed?
Did you maybe use the "Network Activate" function to activate it across sites? I've added a fix in e13a5e0c7c3565e6395ea5a4607248eafb717110 but you can also fix this on the respective sites by deactivating the plugin and re-activating it, it should create the roles.
Yes, I did use the "Network activate" option previously. I just now updated the plugin, then tried Network deactivating, and then Network reactivated, and then tried to accept the friend request again, but I'm still getting the same result as before. Should that work?
Thanks!
No, sorry. I could have explained. Please first delete that user with the role "None" and then send a new friend request. For a friendship to happen the local user needs to have the role "Pending Friend Request" and remote user (i.e. the one accepting) the role "Friend Request."
Also, I haven't released a new version with the fix yet, so please try the deactivate/activate trick on the site that had the user with the role "None" first.
Thanks! Activating each site individually won't be feasible for this particular site, so I'm going to wait for the release, and then test again after that. Thank you!
Any idea when the fix will be released? Thanks!
Does the Friends plugin work in multisite?
On a multisite network site with the Friends plugin installed, I'm getting an error when trying to add a friend: "There has been a critical error on this website."