0rca
Forum Replies Created
-
I‘d say it‘s a bug and afaict we can disable it right after onboarding completed. So it‘s just a nuisance, but Solid should definetely work on these things and make life easier for us.
Didf you enable “Security Check Pro”?
I had the same issue and it only worked, when I kept “Security Check Pro” enabled. Either don’t make this selectable for now or fix the underlying problem soon.
The onboarding process is much faster now compared to earlier versions, but it is still nuisance if we can’t circumvent it, if necessary.
Oh, another night owl ?? Sleep well then ??
And as to why: I am simply trying to list only the “Orderlisten” assigned to the currently logged in user.
But I can’t assign users directly to Orderlisten, so I have created the taxonomy “Objektrechte”. An Orderlist has one Objektrecht assigned, a user can have many Objektrechte and mutliple users can have the same Objektrechte.
This is essentially to achieve a kind of rights-mangement, so that only assigned users can see “their” objects (buildings) and the corresponding Orderlisten (list of products to be ordered).
Here you go: https://cloud.deinhardt.com/s/jR7en7NX7fH6aDE
This is what I have done:
I created the CPT “Orderliste” with a few simple fields.
Then I created a taxonomy “Objektrechte” and enabled as connection to post type “Orderlisten”
I added a field “User” to it:
Field Type: Relationhip
Related Type: User
Bi-directional Field: Objektrechte (objektrechte) [Pod: user]This is the extension of “Users”
Field Type: Relationhip
Related Type: Objektrechte (objektrechte)
Bi-directional Field: User (user) [Pod: objektrechte]Another one of my earlier mistakes, in my OT I partly translated some expressions, thinking it might be clearer. Dumb idea in retrospect…
This is the real non-working shortcode
[pods name="orderliste" where="objektrechte.term_id IN ({@user.objektrechte,rel_to_ids})" template="Orderlisten"]
Since
{@objektrechte,rel_to_ids}
works as expected and since
[pods name="orderliste" where="objektrechte.term_id IN ({@user.objektrechte})" template="Orderlisten"]
outputs the first value of the array, there must be something else wrong with the expression.
Thank you for your patience with me and my misstatements.
Hi Paul, thank you for taking the time to help me. What I failed to mention before was the result of my updated/corrected test. With the correct template
Name {@display_name}
Objectrights {@objektrechte}
Function {@objektrechte,rel_to_ids}it outputs 5 users, and my user is listed like this:
Name Michael Objectrights GFM_R_SUED_UNT_bd, GFM_R_SUED_UNT_bm, GFM_R_SUED_UNT_bs, TROOST_GBR_GMBH Function 336,337,338,340
That means the function works and the array is correctly converted. I.e.
{@objektrechte,rel_to_ids}
lists all values (336,337,338,340).
That means on the other hand, that my shortcode is not working:
[pods name="orderlist" where="objectrights.term_id IN ( {@user.objektrights,rel_to_ids} )" template="Orderlist"]
Do you have any idea what could be going wrong?
Just saw your edit and now I get it, the template of my test was wrong – sorry I missed that.
I have updated the template and it works as expect now. Sorry for being a bit slow…
Now that I see {@objektrechte,rel_to_ids} working correctly. I only have to find out, why it wouldn’t work in my OT context.
- This reply was modified 1 year, 2 months ago by 0rca.
Hi Paul, sorry for the confusion, but I was mixing my OT question with the
[pods name="user" template="Users"]
thing.My orignal problem was
[pods name=”orderlist” where=”objectrights.term_id IN ({@user.objektrights})” template=”Orderlist”]
not working and Jory suggested a function to convert the array of values. But so far this still doesn’t work. But here @user is not in the context of the “User” pods, but the “Orderlist” pods. hence the{@user.objektrights,rel_to_ids}
While trying to figure out why, I tested
[pods name="user" template="Users"]
and this actually outputs this:Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function
So something is not working as expected, it should list all 5 users, not just mine 5 times, right? I don’t really need [pods name=”user” template=”Users”] to work, I was just testing something and it turned out completely unexpected. And I have no clue if my OT problem and this one are related, my grasp of these things is limited at best. So any help is much appreciated, even more so for the OT. The other thing I am just curious about.
- This reply was modified 1 year, 2 months ago by 0rca.
Hi Paul,
so the shortcode will query all existing 5 users, but output only the values of the curent user for each? Or why the 5 outputs?
To me this sounds similar to my still existing problem, i.e. that
{@user.objektrights,rel_to_ids}
does not output anything, maybe because @user is not really defined?
- This reply was modified 1 year, 2 months ago by 0rca.
In order to test the function I just did [pods name=”user” template=”Users”] and this template
Name {@user.display_name}
Objectrights {@user.objektrechte}
Function {@user.objektrechte,rel_to_ids}But I get the result 5 times:
Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function Name Michael Objectrights 336 Function
Either this is unrelated and I simply don’t get it or @user is not unique?
Damn, the code block keeps stripping the quotation marks ??
Edit: I replaced them, now it works.
- This reply was modified 1 year, 3 months ago by 0rca.
Hi Jory,
thank you so much for your help. I guessed something like this, but my coding abilities are extremely basic. I have added the script and changed the shortcode, but get this error (and no output) now:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ) AND ( 't'.'post_type' = 'orderliste' ) AND ( 't'.'post_status' IN ( 'publ...' at line 17
This is the query:
SELECT DISTINCT 't'.* FROM 'wphc_posts' AS 't' LEFT JOIN 'wphc_term_relationships' AS 'rel_objektrechte' ON 'rel_objektrechte'.'object_id' = 't'.'ID' LEFT JOIN 'wphc_term_taxonomy' AS 'rel_tt_objektrechte' ON 'rel_tt_objektrechte'.'taxonomy' = 'objektrechte' AND 'rel_tt_objektrechte'.'term_taxonomy_id' = 'rel_objektrechte'.'term_taxonomy_id' LEFT JOIN 'wphc_terms' AS 'objektrechte' ON 'objektrechte'.'term_id' = 'rel_tt_objektrechte'.'term_id' WHERE ( ( 'objektrechte'.'term_id' IN () ) AND ( 't'.'post_type' = 'orderliste' ) AND ( 't'.'post_status' IN ( 'publish' ) ) ) ORDER BY 't'.'menu_order', 't'.'post_title', 't'.'post_date' LIMIT 0, 15
- This reply was modified 1 year, 3 months ago by 0rca.