Problem with user-plugin on lists that reside on external connection

manne-hoffmann

New Member
Hi there,
I have a problem with the user-plugin when used in a list that uses an external connection instead of the "site-database"

I use 2 user-plugin fields as "created by" / "updated by" which are hidden in the form and only display in the list-view.
The problem is that the list view can only display the raw value(user-id) although both fields are set to display the Name instead of the ID.

When editing/storing the field in the elements-list I get this error-message:
Code:
A join or a list has been added which has no Primary Key. 
Most likely cause is you are creating a new list on a MySQL view, or a join element joining to one. 
Views don't have PKs, and we couldn't find an 'id' element to use. 
If you are creating a list, you will need to manually designate the PK in the list settings now, in the 'Data' tab. 
If you are creating a join element, make sure that a Fabrik list has been created on that view, and the PK designated. 
Once that is done, Fabri will know what field to use as the PK when you create a join to it.

Apparently Fabrik is trying to create a relation from that field to the joomla-user-table which fails because the list is on an external connection ??

Any help is appreciated.

I am using Joomla 3.9.1 with Fabrik 3.9

Looking forward to your answers,
Manfred.
 
Correct. If you tables are on a separate connection, you can't use any joins that join to tables on the main J! database (or to any other connection). And the user element is a join to #__users.

If you just need a field to record the user ID for ACL purposes, create a field, set it to type integer, and use an eval'ed default of ...

Code:
return $this->user->get('id');

-- hugh
 
OK ... I "redsigned" my application, moved all relevant tables back into the site-database and introduced a sophisticated table-prefix-system to keep all the additional tables nicley organized within the Joomla-database.

SOLVED

Thank you
 
Last edited:
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top