Forum Replies Created
-
Closing this topic. I have found it is caused by a filter of my own :-#)
Whoops – hold off responding to this for now. I may have found the cause.
I am still seeing this error when editing the extended profile.
Now on:
WP 6.9.4
BP 2.6.4
PHP version 8.3.30The following error now has trace back:
Warning: Attempt to read property "id" on null in /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-template.php on line 558 Timestamp: 2026-04-20 17:13:41 UTC Stack Trace ----------- 1. bp_get_the_profile_field_id('22') /home/<xxx>/public_html/ovni-owners/wp-content/plugins/ovni-oddments/ovni-oddments.php:213 2. ovni_remove_rich_text(false) /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:343 3. WP_Hook->apply_filters(false, Array(2)) /home/<xxx>/public_html/ovni-owners/wp-includes/plugin.php:205 4. apply_filters('bp_xprofile_is_richtex...', false, 36) /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php:1217 5. bp_xprofile_is_richtext_enabled_for_field(36) /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php:138 6. xprofile_filter_kses('Welsh coast', BP_XProfile_ProfileData) /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-filters.php:225 7. xprofile_sanitize_data_value_before_save('Welsh coast', null, true, BP_XProfile_ProfileData) /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:341 8. WP_Hook->apply_filters('Welsh coast', Array(4)) /home/<xxx>/public_html/ovni-owners/wp-includes/plugin.php:205 9. apply_filters('xprofile_data_value_be...', 'Welsh coast', null, true, BP_XProfile_ProfileData) /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-profiledata.php:222 10. BP_XProfile_ProfileData->save() /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/bp-xprofile-functions.php:526 11. xprofile_set_field_data(BP_XProfile_ProfileData, 441, 'Welsh coast', false) /home/kiivmr5gzlfz/public_html/ovni-owners/wp-content/plugins/buddypress/bp-xprofile/classes/class-bp-xprofile-user-admin.php:209 12. BP_XProfile_User_Admin->user_admin_load('update', 441, Array(67), '/wp-admin/users.php?pa...') /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:341 13. WP_Hook->apply_filters(null, Array(4)) /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:365 14. WP_Hook->do_action(Array(4)) /home/<xxx>/public_html/ovni-owners/wp-includes/plugin.php:570 15. do_action_ref_array('bp_members_admin_updat...', Array(4)) /home/<xxx>/public_html/ovni-owners/wp-content/plugins/buddypress/bp-members/classes/class-bp-members-admin.php:1159 16. BP_Members_Admin->user_admin_load('') /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:341 17. WP_Hook->apply_filters('', Array(1)) /home/<xxx>/public_html/ovni-owners/wp-includes/class-wp-hook.php:365 18. WP_Hook->do_action(Array(1)) /home/<xxx>/public_html/ovni-owners/wp-includes/plugin.php:522 19. do_action('load-users_page_bp-pro...') /home/<xxx>/public_html/ovni-owners/wp-admin/admin.php:242 20. require_once('/home/<xxx>/pub...') /home/<xxx>/public_html/ovni-owners/wp-admin/users.php:11 Context ------- URL : /wp-admin/users.php?page=bp-profile-edit&user_id=441&wp_http_referer=%2Fwp-admin%2Fusers.php%3Fid%3D441&action=update Referer : https://ovni-owners.org.uk/wp-admin/users.php?page=bp-profile-edit&user_id=441&wp_http_referer=%2Fwp-admin%2Fusers.php%3Fid%3D441 HTTP Method : POST HTTP Host : ovni-owners.org.uk HTTP Status : 200 isSSL : Yes Current Filter : load-users_page_bp-profile-edit, bp_members_admin_update_user, xprofile_data_value_before_save, bp_xprofile_is_richtext_enabled_for_field Execution Time : 3.062 s Memory Usage : 131.99 MiB PHP SAPI : litespeed@emaralive – thanks for that. I had tried BuddyPress Messaging Control and thought that was not working too. But I checked again – the user I was testing it on was not of the class I thought they were (duh!).
The basic fuctionality of blocking all private messages for a given class of user is working for me.
Allowing them to still message admins seems to fail to block other messaging. But I can live with what does work.Thanks again.
Yup. I have raised the issue on the All in One WP Security support forum.
Thanks.I have now traced this to the All in One WP Security plugin. If this is disabled, the URL does take me to the login and thence to the message.
I will report it to AIOWPS.
No resolution I have heard of. It would be complicated.
I have adopted a work-around. which is to allow login by email address only. That way, leaking the user name is no longer a security risk.
I second action here.
WP now has a password strength indicator with an option to allow a weak password. There is a plugin here that removes that option, so a user setting their password in the backend cannot set one WP regards as weak.
Bu there is nothing to stop a use setting a very weak password in their BuddyPress profile. It warns you it is weak but still allows it. Please can we have the ability to block that?
@leog371 – thanks for trying to help. That did not do it, however. I am copying below the html presently generated in the hope this might help.
My issue is that the two user names in the list of recent members (John – Paris & Mile Peregrine) are linked to their profiles, but the links only colour when hovering over the links. I need them to be coloured all the time, as my site uses the colouring as visual clue that it is clickable.The colour required is: color: #05a9c5;
thanks
<aside id="bp_core_members_widget-4" class="widget widget_bp_core_members_widget buddypress widget"><h3 class="widget-title"><a href="http://testsite.xxx.org.uk/members/">Welcome to our new members</a></h3> <div class="item-options" id="members-list-options"> <a href="http://testsite.xxx.org.uk/members/" id="newest-members" class="selected">Newest</a> <span class="bp-separator" role="separator">|</span> <a href="http://testsite.xxx.org.uk/members/" id="recently-active-members" >Active</a> </div> <ul id="members-list" class="item-list" aria-live="polite" aria-relevant="all" aria-atomic="true"> <li class="vcard"> <div class="item-avatar"> <a href="http://testsite.xxx.org.uk/members/paris/" class="bp-tooltip" data-bp-tooltip="John - Paris"><img src="//www.gravatar.com/avatar/69299ce42f215930a2181c49f1eb4bef?s=50&r=g&d=mm" class="avatar user-119-avatar avatar-50 photo" width="50" height="50" alt="Profile picture of John - Paris" /></a> </div> <div class="item"> <div class="item-title fn"><a href="http://testsite.xxx.org.uk/members/paris/">John - Paris</a></div> <div class="item-meta"> <span class="activity" data-livestamp="2017-12-17T23:51:09+0000">registered 1 week, 3 days ago</span> </div> </div> </li> <li class="vcard"> <div class="item-avatar"> <a href="http://testsite.xxx.org.uk/members/peregrin/" class="bp-tooltip" data-bp-tooltip="Mike - Peregrine"><img src="//www.gravatar.com/avatar/0e516af4e69f0befa893934cbd29d023?s=50&r=g&d=mm" class="avatar user-118-avatar avatar-50 photo" width="50" height="50" alt="Profile picture of Mike - Peregrine" /></a> </div> <div class="item"> <div class="item-title fn"><a href="http://testsite.xxx.org.uk/members/peregrin/">Mike - Peregrine</a></div> <div class="item-meta"> <span class="activity" data-livestamp="2017-12-02T18:55:20+0000">registered 3 weeks, 4 days ago</span> </div> </div> </li> </ul> <input type="hidden" id="_wpnonce-members" name="_wpnonce-members" value="ab1b45abd0" /> <input type="hidden" name="members_widget_max" id="members_widget_max" value="2" /> </aside>Thank you very much both for your help. After a lot of fiddling about I found the following worked for me:
/* make links in widgets visible */ .widget ul li a { color: #05a9c5 ; }This did the trick… but I had to fiddle with the .css loading priorities to get it to actually work. In my child theme’s functions.php file I had to set a priority for the child-style enqueueing, viz.
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style'),10 ); }mmm.. no luck – but thank you very much for trying.
I have temporarily made the widget visible to non-logged in users. My test site is here.
The links are those to members displayed in the “Welcome to our new members’ widget bottom right.
@leog371 – thanks for trying to help. Unfortunately that does not work.
Herewith the html being generated. I need the user names (John – Paris etc.) to be coloured as a visual hint. At present it only colours when you hover over it.thanks
<ul id="members-list" class="item-list" aria-live="polite" aria-relevant="all" aria-atomic="true"> <li class="vcard"> <div class="item-avatar"> <a href="http://testsite.ovni-owners.org.uk/members/paris/" class="bp-tooltip" data-bp-tooltip="John - Paris"><img src="//www.gravatar.com/avatar/69299ce42f215930a2181c49f1eb4bef?s=50&r=g&d=mm" class="avatar user-119-avatar avatar-50 photo" width="50" height="50" alt="Profile picture of John - Paris"></a> </div> <div class="item"> <div class="item-title fn"><a href="http://testsite.ovni-owners.org.uk/members/paris/">John - Paris</a></div> <div class="item-meta"> <span class="activity" data-livestamp="2017-12-17T23:51:09+0000">registered 1 week, 3 days ago</span> </div> </div> </li> <li class="vcard"> <div class="item-avatar"> <a href="http://testsite.ovni-owners.org.uk/members/peregrin/" class="bp-tooltip" data-bp-tooltip="Mike - Peregrine"><img src="//www.gravatar.com/avatar/0e516af4e69f0befa893934cbd29d023?s=50&r=g&d=mm" class="avatar user-118-avatar avatar-50 photo" width="50" height="50" alt="Profile picture of Mike - Peregrine"></a> </div> <div class="item"> <div class="item-title fn"><a href="http://testsite.ovni-owners.org.uk/members/peregrin/">Mike - Peregrine</a></div> <div class="item-meta"> <span class="activity" data-livestamp="2017-12-02T18:55:20+0000">registered 3 weeks, 4 days ago</span> </div> </div> </li> </ul>@joeaj111 – not sure I understand your question… it is standard BuddyPress stuff:
- Create a blank page for the members list
- Set that page as the Members page in BuddyPress settings
When you display that page you see a list of members and at the top is a search box to search for a member.
I am now using the plugin Dynamic Widgets to hide the login widget on the register page.
This is not as good as hiding the sidebar, but does avoid the problem.
I have solved this problem by filtering the relevant data and processing it with the following, which deals with the escaped sequences I was seeing.
function ovni_decode_escapes($string){ // various characters will be escaped - decode them back $string = html_entity_decode($string, ENT_QUOTES); // deal with escaped quotes $string = str_replace('–', '–', $string); // and the pesky dash return $string; }Thank you very much @danbp. This does exactly what I wanted.
Only ‘problem’ is that I don’t understand how it works. You are setting $field to be the required field definition. Then you set what appears to be the local variable $enabled to false, but don’t reference it any further or return it.
Or is there more to ‘$enabled’ than I am seeing?
Pardon my ignorance.
Sure – it could go in your bp-custom.php file.
I now think this issue is because, although the widget is titled Latest Activity it is actually displaying recent topics and/or replies, which it finds by retrieving those posts and not the activity stream.
@henrywright… not sure exactly what you are doing, but you should be able to only generate the label when there is data
if ($field_content){ return "label: " . $field_content; } else return();Thank you to all who have helped and especially @danbp who took time to explain things at length.
I have finally grasped how this thing works, more or less.I do need to apply the same quite complex filter to both the profile and directory list. I have now devised a common filter function plugin that can be invoked within the members loop as a filter and within the profile display as an action. I have to call it in different ways, depending on where it is being called from, and the trick was to call it from two separate hookable functions. The core of what I have follows:
// Remove standard filtering of profile fields function ovni_init() { remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 ); } add_action( 'bp_init', 'ovni_init' ); // add our replacement filter, which is given a field value, to the members loop function ovni_filter_field_for_directory($field_value){ $field_name=bp_get_the_profile_field_name(); return ovni_get_field_searchable($field_name); } add_filter( 'bp_get_the_profile_field_value', 'ovni_filter_field_for_directory', 50, 1 ); // add fields to directory listing make them searchable according to rules of this plugin function ovni_add_info_to_members_loop() { echo '<div style="position: absolute; left:60px;">', ovni_get_field_searchable('Ovni model'),'</div>'; echo '<div style="position: absolute; left:100px;">', ovni_get_field_searchable('Rig'),'</div>'; echo '<div style="position: absolute; left:275px;">', ovni_get_field_searchable('Home waters'),'</div>'; echo '<div style="position: absolute; left:500px;">', ovni_get_field_searchable('Home port'),'</div>'; } add_action( 'bp_directory_members_item', 'ovni_add_info_to_members_loop' ); // the fuction that makes fields searchable according to the rules of this plugin function ovni_get_field_searchable($field_name) { global $ovni_no_link_fields, $ovni_social_networking_fields; $field_value = xprofile_get_field_data($field_name, bp_get_member_user_id() ); if ( $field_value) { // only if there is content in the field if (is_array($field_value)){ etc. etc.I have not included the code of my filter, but it is changing the way text in profile fields are turned into links, both when displayed in the directory entry and in the members list, thus:
(1) If is an array, serialise into a comma-separated string
(as used in outputing which social web sites a mobile number can be used for)
(2) If is an image, change HTML so that clicking on image will open full size in new tab/window
(3) If any field contians text in [ ], the contents of the [ ] pairs are turned into separate directory searches.
So if the entire text is in [ ] it overrides all other rules
(4) Fields in the list of ‘do not link’ fields are left plain
(5) The user’s web site is converted to its URL
(6) Fields containing social network user names are turned into links to those networks
(7) The remaining are turned into links to search the directory for matches.It has been a learning curve. My formative programming of this type was in the language B (the antecedent of C), which shows how far back I go!
thanks again for the help, Tony
@danbo… thank you for responding. I am struggling – I am not an expert in this and I am unsure what is called by what, and whether the filter you suggest will be invoked by what I had already. I now have your suggestion included:
function add_info_to_members_loop() { echo '<div style="position: absolute; left:60px;">', bp_get_member_profile_data('field=Ovni model'),'</div>'; echo '<div style="position: absolute; left:100px;">', bp_get_member_profile_data('field=Rig'),'</div>'; } add_action( 'bp_directory_members_item', 'add_info_to_members_loop' ); function make_directory_profile_field_searchable() { if ( $value = xprofile_get_field_data('Ovni model', bp_get_member_user_id() ) ) : // as of xprofile_filter_link_profile_data function $search_url = add_query_arg( array( 's' => urlencode( $value ) ), bp_get_members_directory_permalink() ); $clickable = '<div class="click_dir"><a href="' . esc_url( $search_url ) . '" rel="nofollow">' . $value . '</a></div>'; echo $clickable; endif; } add_filter ( 'bp_directory_members_item', 'make_directory_profile_field_searchable' );Your code has the field name ‘Ovni model’ built in and I don’t understand how to pass the field name through from add_info_to_members_loop.
[I still think that if I could work out what is called when a field is displayed in the user profile, that call would deliver what I need in the members loop.]
I have spent a long while trying to fathom this out, so extra help will be really appreciated.
So I am getting my extra user data fields with a line like:
echo '<div style="position: absolute; left:150px;">' , bp_get_member_profile_data('field=Ovni model'),'</div>';
But I would like them to be search links as it is in an individual profile. I have achieved this withecho '<div style="position: absolute; left:60px;"><a href=', $bp->pages->members, '?s=', bp_get_member_profile_data('field=Ovni model'),' rel="nofollow">' , bp_get_member_profile_data('field=Ovni model'),'</a></div>';However, I am now also using the plugin Custom Profile Filters for BuddyPress, which lets me set which profile fields should not be search links and also allows users to spilt their data up, so a profile field “[ocean] and [coast]” gets two separate search links, one for ‘ocean’ and another for ‘coast’. Neat. It seems to do this by adding a filter to bp_get_the_profile_field_value.
However, my manual addition of search links as above ignores these settings, and any [] in the fields comes through and are visible.
It occurs to me that, rather than fetching the fields with bp_get_member_profile_data(), I would do better to get the data however it is got for the individual profile display, as this method puts the search links in and obeys the options set in Custom Profile Filters for BuddyPress. I have spent much of today trying to find how to call bp_get_the_profile_field_value. If I use
echo '<div style="position: absolute; left:150px;">' , bp_get_member_profile_value('field=Ovni model'),'</div>';
I get an invalid link. I suspect it need a data type argument to get a search link. I have tried to find how it is called to display the user profile, but failed to find it. In the BP Codex I have only found how to remove the filter that puts the links in.If someone could enlighten me it would be most helpful. Thanks.
Thank you, thank you for your clear and authoritative reply.
I adopted method (2) as it seemed easier for me and I now have the result I wanted.
Very happy!
TonyI have a solution to this – I have written a minimal plugin that diverts to a ‘denied’ page if a non-logged-in user tries to access the private type of information. I still allow the profile to be displayed as that has its own permissions arrangements. Here is my plugin:
<?php /* Plugin Name: Make certain pages private Description: Specifically for ******** website: prevents not-logged-on users from seeing certain pages otherwise visible Version: 1.0 Author: Tony ***** */ function check_for_private_pages() { if (is_user_logged_in() == true){ /* nothing to do if logged in */ return; } else { if (bp_is_activity_component() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_groups_component()){ header('Location: http://'. $_SERVER["HTTP_HOST"] . '/oops-cant-get-you-where-you-tried-to-go/'); } } } add_action('template_redirect', 'check_for_private_pages'); ?>OK – in the absence of anyone enlightening me, I set up a test site with just WP, BuddyPress and bbPress, together with the plugin ’email log’. I determined that emails are not sent by bbPress.
I have now installed BuddyPress Forum Notifier, which seems to do the job.
I am presently experimenting with cron to ensure the batching of comments works reliably.