Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Missing Activity Log: "[user] changed his profile picture"

AoleeAolee Hobbyist & Coder ✭✭

Hi people,

Just want to ask those who are using vanilla 2.1 , not sure if its only my forum. when i tried changing my profile pic. I don't see anymore in recent activity page the message saying "[user] changed his profile picture" . was it removed on 2.1? Thanks.

  • Aolee
Tagged:

Best Answers

  • Options
    peregrineperegrine MVP
    edited January 2014 Answer ✓

    problem is with the current code $OldPhoto will actually always be equal to $Photo because the check is made too late. Therefore an activity record will never be written.

    Yes I believe you found a bug in

    /applications/dashboard/models/usermodel.php

    to make it add to activity and check photo correctly...
    you could change the code form

                     $this->SQL->Put($this->Name, $Fields, array($this->PrimaryKey => $UserID));
    
                       // Record activity if the person changed his/her photo.
                       $Photo = ArrayValue('Photo', $FormPostValues);
                       if ($Photo !== FALSE) {
                          if (GetValue('CheckExisting', $Settings)) {
                             $User = $this->GetID($UserID);
                             $OldPhoto = GetValue('Photo', $User);
                          }
    
    
    
    to
    
    
                      if (GetValue('CheckExisting', $Settings)) {
                             $OldPhoto = GetValue('Photo', $User);
                          }
    
                       $this->SQL->Put($this->Name, $Fields, array($this->PrimaryKey => $UserID));
    
                       // Record activity if the person changed his/her photo.
                       $Photo = ArrayValue('Photo', $FormPostValues);
    
                       if ($Photo !== FALSE) {
                          if (GetValue('CheckExisting', $Settings)) {
                          $User = $this->GetID($UserID);
                          //   $OldPhoto = GetValue('Photo', $User);
                      }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    peregrineperegrine MVP
    edited January 2014 Answer ✓

    @Aolee said:
    that's perfect! :) Thanks Peregrine!

    no prob. :) glad it worked. nice find.

    I put your "issue" on github with above solution.

    https://github.com/vanillaforums/Garden/issues/1774

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • Options
    peregrineperegrine MVP
    edited January 2014 Answer ✓

    problem is with the current code $OldPhoto will actually always be equal to $Photo because the check is made too late. Therefore an activity record will never be written.

    Yes I believe you found a bug in

    /applications/dashboard/models/usermodel.php

    to make it add to activity and check photo correctly...
    you could change the code form

                     $this->SQL->Put($this->Name, $Fields, array($this->PrimaryKey => $UserID));
    
                       // Record activity if the person changed his/her photo.
                       $Photo = ArrayValue('Photo', $FormPostValues);
                       if ($Photo !== FALSE) {
                          if (GetValue('CheckExisting', $Settings)) {
                             $User = $this->GetID($UserID);
                             $OldPhoto = GetValue('Photo', $User);
                          }
    
    
    
    to
    
    
                      if (GetValue('CheckExisting', $Settings)) {
                             $OldPhoto = GetValue('Photo', $User);
                          }
    
                       $this->SQL->Put($this->Name, $Fields, array($this->PrimaryKey => $UserID));
    
                       // Record activity if the person changed his/her photo.
                       $Photo = ArrayValue('Photo', $FormPostValues);
    
                       if ($Photo !== FALSE) {
                          if (GetValue('CheckExisting', $Settings)) {
                          $User = $this->GetID($UserID);
                          //   $OldPhoto = GetValue('Photo', $User);
                      }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    AoleeAolee Hobbyist & Coder ✭✭

    that's perfect! :) Thanks Peregrine!

  • Options
    peregrineperegrine MVP
    edited January 2014 Answer ✓

    @Aolee said:
    that's perfect! :) Thanks Peregrine!

    no prob. :) glad it worked. nice find.

    I put your "issue" on github with above solution.

    https://github.com/vanillaforums/Garden/issues/1774

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.