Skip Navigation

[Resolved] Make user able to create her own Collection (one) of Artworks (many) View

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 30 replies, has 2 voices.

Last updated by FRANCESCOD7762 3 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1620843
relationship-views.JPG

I have done lots of modifications in your website, here are detail steps:
Edit the view
In section "Query Filter", fix all filters:
hidden link

In section "Loop item in Oeuvres du Membre", add a delete relationships link:
[cred-delete-relationship role_items='$fromViews' relationship='membre-oeuvre' redirect='self']Delete this relationship[/cred-delete-relationship]

1) Login into your website as user "Toolset":
Open URL
hidden link
Fill and submit the form, it should create and redirect me to a new "Member" post, the post author is current logged-in user "Toolset"
hidden link

2) Edit the Oeuvres post
hidden link
In section "Content Template", choose option option "Single Oeuvres post CT", and save

3) Test above Oeuvres post in front-end:
hidden link
You should be be able to see a button "Ajouter à ma collection", click it, it will setup relationship between "Member" post(step 1) and Oeuvres post

4) Open "Member" post in front-end again:
hidden link
I can see it works fine. I can see the result and can remove relationship with the link. see screenshot: relationship-view.JPG

#1621087

Hi Luo,

Thank you very much for these improvements. I really appreciate.
I logged into the site with one of the existing users, which did not have a Member Post yet:
- username : g.dormand@sleep.net
- password : G_dormand@nuitsanslune
I filed the form and got redirected to the /collection-de-membre/ page : so far, so good.
Then I went to 2 Single Oeuvres : IDG-913 L'ancêtre, and IDG-686 Le défilé, and for both I cliqued the button "Ajouter à ma collection".
Returning to the /collection-de-membre/ page, I could see the 2 Oeuvres, with the cred-delete-relationship link :
- but, unfortunately, this link does not work : here is the url it is pointing to :
--- for "Le défilé" : hidden link
--- for "L'ancêtre" : hidden link
- it is the same url.
Returning to the Single Oeuvre "Le défilé", the cred-delete-relationship link does not work either, and here is the url it is pointing to :
--- hidden link
- could be OK for not redirecting to anything, which is what we want, because we prefer that the user explores more Oeuvres to pèut them in his collection. BUT it does not take "Le défilé" out of the collection-de-membre !
Same for "L'ancêtre".

Honestly I have no idea why this worked for you, and not in this case.
Thank you for checking is out.
Best regards,
Francesco

#1621123

I have tried again in your website, with below steps:
1) Login as user: g.dormand@sleep.net
2) Open URL:
hidden link
I can see the problem you mentioned above:

this link does not work

And I see below JS error in my Chrome browser console window:

Uncaught SyntaxError: Unexpected token '}'

It is a JS error from your custom JS codes of content template "loop-item-in-oeuvres-du-membre":

function singlePointer (){
  return location.href.includes("en") ? location='location.origin' + '/en/' + [wpv-post-slug]
}  

Please try to remove those JS codes and test again.

And I have tried to login your website with the administrator user "Toolset", the credentials is not valid any more, I get this error message:
ERREUR : ce mot de passe ne correspond pas à l’identifiant support@toolset.

Please check it.

#1622629

Hi Luo,

Sorry for changing the credentials for Toolset. I re-set them as originally :
- username : support@toolset
- password : ToolsetSupport$1$2$3

I removed the JS in the "loop-item-in-oeuvres-du-membre". I should have checked the Dev Tools...

When I log in as support@toolset (WP role : Administrator), all works fine : adding to the Member and deleting from the Member (in both the Member Post and the Single Oeuvre Content Template)

BUT when i log in as g.dormand@sleep.net (credentials not changed; WP roles : GiveWP Subscriber and Subscriber - French "Abonné"), I can only add to the Member :
- the cred-delete-relationship link does not work : not inthe Member Post ; not in the Single Oeuvre Content template

I think it may be an issue of Permissions :
- I checked the WP user Permissions for g.dormand@sleep.net : but could not figure out what permissions to assign to which contents. All I tried failed
- I also tried to manage the permissions via the Toolset Access Manager. No success either.

In this site, all registered users have the role of GiveWP Subscriber, because they are only registered if they subscribe to a recurring donation to our Association, via the GivwWP Donation Plugin. The "Subscriber" or in French "Abonné" WP role is added on top.

Thank you, Luo, for testing again with the credentials of both of the users mentionned above.
Best regards,
Francesco

#1624043

Thanks for the details, I can see the problem, and trying to export your database dump file into my localhost, will update here if there is anything found

#1625347

Here are what I found, it is a known issue, see our erratum:
https://toolset.com/errata/non-administrator-users-cannot-disconnect-related-posts-using-the-delete-relationship-links/
Non-administrator users cannot disconnect related posts using the Delete Relationship links

Our developers are working on it, currently, you can try these:
Dashboard-> Toolset-> Access control-> Custom roles, find role "Give Subscriber", click link "Change permissions":
in tab "General capabilities", enable option "manage_options", and test again.

#1625483

Hi Luo,
Brilliant! It works for User g.dormand@sleep.net, who is a GiveWP Subscriber.
Adding and deleting work in the Member Post and in the Single Oeuvre Template, and they are updating each other (when deleting in the Member post, the Single Oeuvre Template displays the Add button)

Now all is well: we see the light at the end of the tunnel!...
I have only one very last concern:
- when I want to go back to the Member Post (/collection-de-membre/), I land on the page with the name of the Author/loggedin User as a link to the actual Member Post, pointing to : /membre/gerard-dormand/
- so how can I configure a link (for instance in the Menu) whith the url : "/member/" and then the current Member slug, like here "gerard-dormand/" ?

Thank you for this last bit.
Best regards,
Francesco

#1628363

You can get current user's login name with shortcode: [wpv-user field="user_login"]

Then use above shortcode to setup the HTML links, for example:

<a href="/member/[wpv-user field="user_login"]/"> some text ...</a>
#1629331

Hi Luo,
Thank you for this short code [wpv-user field="user_login"]. I tworks fine now.

I have to say that your exemplary patience and work have taught me a lot during these weeks of efforts to resolve the diverse issues posed by this "Add to Favorite" feature.

As a conclusion, I have to ask you a more general question concerning the integration of Toolset with Elementor :
- Toolset has 2 Elementor Widgets : Toolset Views and Toolset Forms
- Why is it not possible to put a Relationship Form into an Elementor Widget ? (instead of just into a Toolset content template)

Elementor has an ACF form widget supporting 'relationship' url. It would be a great motivation to adop Toolset for many Elementor users, to have an Elementor Toolset Relationship Form Widget. The Elementor users market is quite a big one for Toolset to tap into, even though your goal is to push the Block Editor, in order to promote Toolset as a total solution for WordPress...

I do not know if you have participated in the development of the Elementor / Toolset integration; if not, maybe it would be interesting to ask that question to your colleagues who did develop this integration.

Thank you for finding out about this last concern.
Best regards,
Francesco

#1630287

OK, I am checking it with our developers, will update here if there is any news.

#1630617

Great.
I asked the Elementor Team also and they answered that the Toolset developers can contact them if they need any help.

#1631653

Here is feedback, there isn't such kind of built-in feature within Toolset Forms plugin, you can add a feature request for it here:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Our developers will evaluate it. thanks

#1631761

Hi Luo,

Thank you for the feed back.
I submitted a feature request for a Toolset Relationship Form Widget for Elementor.
Let see what happens...

Thank you again for your pationt work on this issue, which is now resolved.
Stay safe.
Best regards,
Francesco

#1631765

My issue is resolved now. Thank you!

#1771649
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.