Project

General

Profile

Actions

Bug #2166

closed

cbUser class caching causing field display issues

Added by krileon over 13 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
03 January 2011
Due date:
% Done:

100%

Estimated time:
2:00 h

Description

When Username field is set not to display on profile and an integration (CB LastView) uses the cbUser class to obtain the Username, Name, and/or Avatar fields with the $reason as "list" it is resulting in the Username field suddenly being displayed again.

I do not know if is directly related to just that plugin, but have traced to the following line of code.


$cbUser = CBuser::getInstance( $lastview->viewer_id );
$name = $cbUser->getField( 'name', null, 'html', 'none', 'list' );
$username = $cbUser->getField( 'username', null, 'html', 'none', 'list' );
$avatar = $cbUser->getField( 'avatar', null, 'html', 'none', 'list' );

With the above section removed the Username field does not display on profile as configured. If the getField function is used then the Username field is suddenly displayed again (didn't seam to matter which field). I also tried using cbUser with &, but same result.

http://www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,125/id,145222/#149873

Actions #1

Updated by beat about 13 years ago

  • Estimated time set to 2:00 h
Actions #2

Updated by beat about 13 years ago

  • Status changed from New to Feedback
  • Assignee changed from beat to krileon

Kyle,
I'm not sure how to reproduce this one.
Can you please tell me how or even better analyze and suggest a patch ?
Many thanks

Actions #3

Updated by krileon about 13 years ago

  • Assignee changed from krileon to beat

To reproduce
Install LastViews plugin
Set Name field (ensure CB is configured to use Name) to not display on profile
Publish LastViews Tab plugin in plugin management
Once done view profile and Name field will be visible
This happens even with GJ 2.0 and Username field

Actions #4

Updated by krileon about 13 years ago

GJ 2.0 uses the below.

$cbUser =& CBuser::getInstance( $row->user );

if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}

$cbUser->getField( 'formatname', null, 'html', 'none', 'list' )

Which if not present this issue doesn't happen.

Actions #5

Updated by krileon about 13 years ago

Removing $cbUser->getField( 'formatname', null, 'html', 'none', 'list' ) resolved the issue, so it seams related to calling a field through API.

Actions #6

Updated by krileon about 13 years ago

FROM:
static $prefetched = null;
static $fieldsByName = null;

TO:
$prefetched = null;
$fieldsByName = null;

Within _getTabFieldsDb resolved the issue. The above change was just a test (disabled caching). Seams there's an issue with the fields cache, probably being overwritten by additional calls.

Actions #7

Updated by beat about 13 years ago

I believe this issue is in lastviews tab as present with CB 1.3.1 already.

Actions #8

Updated by beat about 13 years ago

  • Target version changed from CB 1.4.0 to CB 1.7
Actions #9

Updated by beat over 12 years ago

  • Status changed from Feedback to Resolved
  • Assignee changed from beat to krileon
  • % Done changed from 0 to 100

I believe that this one is resolved with latest CB 1.7 svn (or B1) as I have redone the caching of CB fields lists.

Kyle,
Can you please confirm it's fixed ? :)

Actions #10

Updated by krileon over 12 years ago

  • Assignee changed from krileon to beat

Confirmed resolved using latest SVN.

Actions #11

Updated by beat over 12 years ago

  • Status changed from Resolved to Closed

Thanks.
Closing as fixed.

Actions

Also available in: Atom PDF