problem CB with fabrik

samani

Member
hi,
i install CB plugin of fabrik but get this error when i go to user profile :
Call to a member function get() on null
 

Attachments

  • 2018-12-17_20-58-18.png
    2018-12-17_20-58-18.png
    50.6 KB · Views: 276
  • 2018-12-17_21-02-57.png
    2018-12-17_21-02-57.png
    106.4 KB · Views: 359
i implement some trick for example use CB Custom Html with enabled content option and it work but how i can use fabrik-prefilter to load result related to this user?
i use this in Custom field: {fabrik view=list id=1}
 
Set a prefilter in the list:
where <your_field_containing_user_id> equals {$their->user->id}, and set type to text.
 
Set a prefilter in the list:
where <your_field_containing_user_id> equals {$their->user->id}, and set type to text.
tahnk you lousyfool but it is not work.

@hugh, can you reply me what need to do? is integrated work correctly?
 
Well, you're asking Hugh, but trust me, I have this running here: a Fabrik list loading in a CB user profile tab displaying only the data for this user = the list rows where what I called "<your_field_containing_user_id>" contains the user ID.
(I'm using a Fabrik module, but surely it's all the same when using the content plugin.)

What's the table you want to display, what's the name of the field containing the user ID?
Have you made sure you're selecting the "raw" field in the prefilter?
Any more detailed information of what you have and what you are doing available?
 
Thanks for the screencast, I tried following it.

Hmmm, perhaps it's best if I describe step by step what I did to achieve what seems to be a very similar task:
In a tab in CB user profiles, display a Fabrik list containing only the rows related to this CB user profile. Actually, it's the table with CB "Profile Updates": #__comprofiler_plug_pulogger, where the ID is in the column "profileid".
So, while this may be slightly different from what you need (list module vs menu item, PU logger vs a different table in your case, etc...), the concept should be the same, so it may help you and perhaps others to replicate for your use case:

1. Create a list for the table in question (#__comprofiler_plug_pulogger). In my case, no list joins or pre-filters are set, I only set "Order by" in the Data tab and ACL to my particular needs.
In case you're using the list elsewhere fo other purposes as well and set pre-filters on list level, make sure you get the "Overridden by menu/modules" right, of course.

2. Create a module of the type Fabrik List, select the list and save. Configure the module to your needs.

3. In the module, Advanced tab, click Prefilters and set it to:
AND
(for Elements) profileid (or whatever the user ID field's name is in your case... I did not choose "raw" but the "non-raw" option)
EQUALS
(for Value) {$their->user->id}
(for Type) Text (if you chose a "raw" field or there's no choice, you may want to select "No quotes" instead)
(for Access) make sure it's set right, otherwise no joy!

4. Close and save, then insert module in a CB tab the usual way.

So, as already stated, this works perfectly fine for me.

You may play with the variable/placeholder. As per Wiki (you linked to it) where it's said that ($their->yyy->xxx) works similar to the {$my->xxx} placeholder, you might also get it working with just {$their->id}, not sure. Also, since CB comes with its own placeholders, you may try using one of theirs (look up with CB which one it is).

Hope it helps.
 
Hi,

Watched your screencast -- very entertaining :)

What I didn't see you trying is, as suggested in my previous post, using CB's own placeholder.

I haven't tried this instead of what I've got in use (and I will not do so on the live site, sorry), but as described here, it should be something like
Code:
[cb:userdata field="user_id" user="#displayed" /]
If this type of CB placeholder works at another place or with another field variable in a profile on your site, it may well do the job here, too.
Try that?

By the way, no need for another screencast... "tried it, did (not) work" or so will do! Also, because if this does not work, I'm running out of ideas...
 
Sorry, I've edited the post above because I had wrongly "#me" in it... while you need "#displayed"...
 
i can do that with this code and it work:
Code:
global $_CB_framework;
$userid=$_CB_framework->displayedUser(); //work in single user profile view not in list view
return $userid;
you can use that in the calc element but must use when cb profile is show. i use {fabrik view=details id=1} in the CB Custom field.
but it is not work in the list view of CB.
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top