User Custom Field Cache

Discussion in 'aMember Pro v.4' started by incirus, Apr 21, 2012.

  1. incirus

    incirus New Member

    Joined:
    Feb 27, 2012
    Messages:
    21
    I created custom fields for the user and a form to change these fields.
    Everything works fine up till this point.
    When I call these custom fields outside of amember, it brings the cached version of the field value till user logout and login again.

    Here is how I call the user values;
    include("amember/library/Am/Lite.php");
    $user = Am_Lite::getInstance()->getUser();
    echo $user['user_custom_field'];

    Is there any way to clear the cache after user updates his information?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    So do you have these fields from aMember profile form or from your custom form? How do you change these fields exactly?
  3. datehottergirls

    datehottergirls New Member

    Joined:
    Sep 1, 2010
    Messages:
    7
    I'm looking for the same answer.

    I am using the aMember profile form alongside the WordPress plugin.

    After updating and saving from the Profile Form, the following code does not provide the updated user data:
    PHP:
    $user am4PluginsManager::getAPI()->getUser();
    echo 
    $user['user_custom_field'];
    After user logs out and logs back in, the correct user data is returned.

    This holds true for both PHP Sessions and aMember Session Mgmt.
  4. kinitex

    kinitex Member

    Joined:
    Aug 28, 2009
    Messages:
    50
    Same problem here, the called data is only updated if the user logs out and then back in.

    Whats the fix for this?
  5. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    This has been fixed. Fix will be available in next versions. If you need it faster, contact support and ask to provide latest version of /amember/application/default/controllers/ProfileController.php
  6. kinitex

    kinitex Member

    Joined:
    Aug 28, 2009
    Messages:
    50
    I downloaded 4.2.11 and seen the changes in ProfileController.php but it's still not updating info I'm displaying on the main members page.
  7. kinitex

    kinitex Member

    Joined:
    Aug 28, 2009
    Messages:
    50
    Ok I got it updating I had a small bug in my form that I fixed.

Share This Page