Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

CB Profile Update Logger does not save any log when creating new user

  • neomediatech
  • neomediatech
  • ONLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
  • Add-ons
4 days 17 hours ago #340046 by neomediatech
Hi,
I created a custom function in order to allow a privileged user to update a user via frontend following your tutorial published here www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18362-registering-a-user-through-cb-api
When I save the form the user is updated successfully but no log is saved in CB Profile Update Logger.
Can you help me to trace the user update?
Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
4 days 14 hours ago - 4 days 14 hours ago #340048 by krileon
The linked documentation should work fine as long as your user update code is calling the onAfterUserUpdate trigger as that's what CB Profile Update Logger is using to log updates. Is your custom implementation happening in frontend or backend? Frontend and backend have different triggers and CB Profile Update Logger has to be explicitly configured to log backend changes.

It might just be a plugin loading issue though. Be sure you've also the below code.
Code:
global $_PLUGINS; $_PLUGINS->loadPluginGroup( 'user' );

See the below documentation regarding loading API externally.

www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18357-including-cb-api-for-usage-outside-of-cb


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 4 days 14 hours ago by krileon.

Please Log in or Create an account to join the conversation.

  • neomediatech
  • neomediatech
  • ONLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
  • Add-ons
3 days 13 hours ago #340052 by neomediatech
My custom implementation is happening in frontend. The form allows a privileged user to modify the data of another user.
I tried to add $_PLUGINS->loadPluginGroup( 'user' ); as suggested. The user data are correctly saved but CB Profile Update Logger does not register the log of the modify

This is my code:
        protected function CBeditUser( $user_id, $customer ) {
                include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
                include_once( JPATH_ROOT . '/libraries/CBLib/CB/Legacy/LegacyComprofilerFunctions.php' );
                cbimport( 'cb.html' );
                global $_CB_framework, $_PLUGINS, $ueConfig;
                $_PLUGINS->loadPluginGroup( 'user' );

                .....some code....

                foreach($customer as $key => $data){
                        $user->set( $key, $customer[$key] );
                }
                $user->set( 'name', trim( $customer . ' ' . $customer ) );
                $_PLUGINS->trigger( 'onBeforeUserUpdate', array( &$user, &$user, &$oldUserComplete, &$oldUserComplete ) );

                if ( ! $user->store() ) {
                        return false;
                }

                $_PLUGINS->trigger( 'onAfterUserUpdate', array( &$user, &$user, $oldUserComplete ) );
        }

Where am I wrong?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
3 days 12 hours ago #340053 by krileon
Your code is missing the $oldUserComplete handling. CB Profile Update Logger compares the previous field value with the changed field value to determine if it needs to log an entry. The example provided at the bottom of the below tutorial shows how to prepare that object.

www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18362-registering-a-user-through-cb-api


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • neomediatech
  • neomediatech
  • ONLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
  • Add-ons
2 days 18 hours ago #340054 by neomediatech
I found another error in the code. Now it is ok!
Thanks!
I suggest to add  $_PLUGINS->loadPluginGroup( 'user' ); in this guide www.joomlapolis.com/documentation/127-community-builder/279-tutorials/18362-registering-a-user-through-cb-api
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

  • neomediatech
  • neomediatech
  • ONLINE
  • Posts: 4
  • Thanks: 1
  • Karma: 0
  • Add-ons
2 days 13 hours ago #340055 by neomediatech
CB Profile Update Logger does not save the log when the creation of a new user occurs
Could you add "onAfterUserRegistration" trigger to the "CB Profile Update Logger" plugin? This change will help all of us to make "Community builder" more GDPR compliant.
Thanks

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum