Skip Navigation

[Resolved] When editing a "Angebot" child element I can't connect a parent "akteur"

This support ticket is created 3 years, 9 months 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: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 3 voices.

Last updated by romanF 3 years, 8 months ago.

Assisted by: Jamal.

Author
Posts
#1967891

Hey,

I have an issue with my toolset page. I have "angebote" (offers) and "anbieter"(provider) offers do have a child-to-parent relationship with the provider. This is selected via a front-end form when creating the offer.

User can also edit their offers via a front end form. But when they do that the list of providers is empty AND the current connection is lost when saving.

I have no idea why this is the case.

Here's the credform for the edit - the relevant point is called: "Akteur zuweisen:"
Angebote bearbeiten:[credform]
<div class="form-group">
<label style="font-weight: bold">Angebot Titel:*</label>
[cred_field field='post_title' class='form-control' output='bootstrap']
<p style="color:gray; font-size:10px"> Geben Sie hier einen Titel für ihr Angebot ein.</p>
</div>

<div class="form-group">
<label style="font-weight: bold">Kurzbeschreibung:*</label>
[cred_field field='kurzbeschreibung' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label style="font-weight: bold">Angebotsbeschreibung:*</label>
[cred_field field='angebotsbeschreibung' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label style="font-weight: bold">Beitragsbild:</label>
[cred_field field='beitragsbild' force_type='field' class='form-control' output='bootstrap' previewsize='thumbnail']
<p style="color:gray; font-size:10px"> Sie können auch mehrere Bilder hochladen. Wichtig: Stellen Sie sicher, dass Sie nur Bilder hochladen deren Copyright Sie für diesen Zweck besitzen! </p>
</div>

<div class="form-group">
<label style="font-weight: bold">Zielgruppen:</label>
[cred_field field='zielgruppe' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
<div class="form-group">
<label style="font-weight: bold">Gruppengrößen:</label>
[cred_field field='gruppengrose' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
<div class="form-group">
<label style="font-weight: bold">Angebotsarten:</label>
[cred_field field='angebotsart' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
<div class="form-group">
<label style="font-weight: bold">Themen:</label>
[cred_field field='thema' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
<div class="form-group">
<label style="font-weight: bold">Angebotsdauer:*</label>
[cred_field field='angebotsdauer' force_type='field' class='form-control' output='bootstrap']
<p style="color:gray; font-size:10px"> Geben Sie die Angebotdauer als Zahl in Minuten ein.</p>
</div>
<div class="form-group">
<label style="font-weight: bold">Kostenlos:</label>
[cred_field field='kostenlos' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label style="font-weight: bold">Kosten</label>
[cred_field field='kosten' force_type='field' class='form-control' output='bootstrap']
<p style="color:gray; font-size:10px"> Geben Sie die Kosten ein.</p>
</div>
<div class="form-group">
<label style="font-weight: bold">Veranstaltungsort:</label>
[cred_field field='veranstaltungsort' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label style="font-weight: bold">Bezirk/Vor Ort</label>
[cred_field field='veranstaltungsort' force_type='taxonomy' output='bootstrap' display='checkbox']
</div>
<div class="form-group">
<label style="font-weight: bold">Permanentes Angebot:</label>
[cred_field field='permanentes-angebot' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
<label style="font-weight: bold">Veranstaltungsdatum:</label>
[cred_field field='veranstaltungsdatum' force_type='field' class='form-control' output='bootstrap']
</div>
<label style="font-weight: bold">Bildungsmaterial:</label>
[cred_field field='bildungsmaterial' force_type='field' class='form-control' output='bootstrap']
<p style="color:gray; font-size:10px"> Falls Sie Bildungsunterlagen anbieten möchten, können Sie Sie hier zum Download zur Verfügung Stellen. Wichtig: Stellen Sie sicher, dass Sie sämtliche dafür benötigte Copyrights besitzen!</p>
</div>
<div class="form-group">
<label style="font-weight: bold">Verfügbarkeit:</label>
[cred_field field='verfugbar' force_type='field' class='form-control' output='bootstrap']
<p style="color:gray; font-size:10px"> Sollte das Angebot ausgebucht sein, entfernen Sie hier den Haken. So bleibt es sichtbar, jedoch mit dem Vermerk: Ausgebucht.</p>
</div>
<div class="form-group">
<label>Akteur zuweisen</label>
[cred_field field='@angebotszugehorigkeit.parent' class='form-control' output='bootstrap' select_text='--- nicht eingestellt ---' required='false' author='$current']
<p style="color:gray; font-size:10px"> Weisen Sie hier den Akteur zu, sollten Sie keinen zur Auswahl haben, müssen Sie erste einen Akteur unter "Mein Konto" anlegen. Sie können den Akteur aber auch nachträglich hinzufügen.</p>
</div>
<p></p>
<div class="form-group">
<p><label style="font-weight: bold; font-size:20px">Kooperationen</label><br>
<label >Wählen Sie die Anzahl der Kooperationen aus. Setzen Sie dementsprechend viele Haken.</label></p>
[cred_field field='kooperationspartner-1' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='kooperationsart-partner-1' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">

[cred_field field='logo-kooperationspartner-1' force_type='field' class='form-control' output='bootstrap' previewsize='thumbnail']
<p style="color:gray; font-size:10px"> Laden Sie hier das Logo des Partners hoch.</p>
</div>
<div class="form-group">

[cred_field field='kooperationpartner-1-url' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner2' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner2-kooperationsart' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner2-logo' force_type='field' class='form-control' output='bootstrap' previewsize='thumbnail']
<p style="color:gray; font-size:10px"> Laden Sie hier das Logo des Partners hoch.</p>
</div>
<div class="form-group">
[cred_field field='partner2-url' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner-3' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner3-kooperationsart' force_type='field' class='form-control' output='bootstrap']
</div>
<div class="form-group">
[cred_field field='partner3-logo' force_type='field' class='form-control' output='bootstrap' previewsize='thumbnail']
<p style="color:gray; font-size:10px"> Laden Sie hier das Logo des Partners hoch.</p>
</div>
<div class="form-group">
[cred_field field='partner3-url' force_type='field' class='form-control' output='bootstrap']
</div>
<p style="color:gray; font-size:12px"> *Erforderliche Angaben.</p>
[cred_field field='form_messages' class='alert alert-warning']
[cred_field field='form_submit' output='bootstrap' value='Speichern' class='btn btn-primary btn-lg']
[/credform]

#1968849

Hello and thank you for contacting the Toolset support.

At first sight, I would say that none of the parent posts is created by the current user. As you can see on the relationship field, it uses the author='$current' attribute, which will limit the parent posts to only those created by the current user. Does it make sense?

If that's not the case, I'll need more details and probably access to your website to check this further.

#1970313
NoProvider.jpg

Hi Jamal,

thanks for looking at this issue too.
Your assumption is not the case. You can only edit your own offers therefore if you can edit them you are also the owner.
In the test case I have just created the offer and then seconds thereafter I tried to change the provider but the list was empty AND the old connection was lost.

I have created an Account for you for my other ticket. https://toolset.com/forums/topic/provider-view-is-limited-and-does-not-show-all-max-provider/

You can use I to look into this issue as well. I'll create an offer for this account and will connect your provider with it.

Interestingly, the code I have posted in the initial request does work if you create the offer but not if you edit it.

Thank you for your help.

#1970811

Thank you for the credentials, I confirm they work for me.

You said Your assumption is not the case. You can only edit your own offers therefore if you can edit them you are also the owner.
I agree, but when I say author='$current' will return only the posts authored by the user, I was talking about the parent post "Akteure". Can you confirm that the user has authored some "Akteure" posts? If yes, those posts and only those must appear in the relationship field.

I would like to investigate it further but I don't know what form and where it is being used. I assume that we are talking about "Angebot bearbeiten (ID: 884)" form because it is the only one to edit Angebot posts.
But can you tell me where it is used? Can you share a URL where I can see it on the frontend?
Can you also provide a test scenario like, so I don't have to guess, as you may know, we work on different client's website each day and we'll easily lose track:
1. I go to xxx
2. I do xxx
3. I expect to have xxx
4. Instead, I get xxx

#1970885
NoProvider2.jpg

Yes, the user, in this case, the test user that I have created for you has an "aktuer", a provider created. You can see this on the your account page. The one that is listed there.

Please follow the steps on the image I have provided.
visit: hidden link

You'll find the form through the ID: 884 it is used on the page with the ID: 920

#1972111

Thank you for the details, I can see the issue now. Removing the field and adding it again did not help. Even if we remove the author attribute the field remains empty.

I would like to debug this issue on my local setup. Would you allow me to take a copy of your website?

#1972199

Hi Jamal, thanks for taking a closer look.
Sure, take a copy for the debugging process. Do you need anything from my side to create the copy?

#1972585

I tried with a new form and the issue was not reproduced on it. Then I updated the Toolset plugins and tried in a minimal setup(TwentyTwenty theme+only Toolset plugins) to no avail.

Let me reach out to our 2nd Tier for assistance on this and I'll get back to you as soon as possible.

#1973675

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Jamal is off today and tomorrow, so let me jump in with the solution.

I identified that there is a problem with broken markup in the form, specifically a closing div without an opening div.

If you locate where you insert the bildungsmaterial field, you will see that it is missing the opening div for that field (present on all other fields), although it has the closing div, which breaks the form markup.

You can either delete the spare closing div, or re-instate what would be the opening div, like so:

    <div class="form-group">
    <label style="font-weight: bold">Bildungsmaterial:</label>
		[cred_field field='bildungsmaterial' force_type='field' class='form-control' output='bootstrap']
      <p style="color:gray; font-size:10px"> Falls Sie Bildungsunterlagen anbieten möchten, können Sie Sie hier zum Download zur Verfügung Stellen. Wichtig: Stellen Sie sicher, dass Sie sämtliche dafür benötigte Copyrights besitzen!</p>
	</div>

If you can confirm, then please go ahead and mark this as resolved.

#1973703

My issue is resolved now. Thank you!