Skip Navigation

[Resolved] Cred form is not showing current child post parents in select

This support ticket is created 6 years, 1 month 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.

Our next available supporter will start replying to tickets in about 2.42 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 31 replies, has 3 voices.

Last updated by katjaL 6 years ago.

Assisted by: Beda.

Author
Posts
#1129559

I have a post type "unit" which can have multiple children "positions". I have created a cred form which adds these "positions". The form is inserted into "unit" single page. The cred form is added by wizard and if I understand right the parents should be automatically available in the select field. But they are not, the select field is empty. So have I understood something wrong?

This site is a bit different in a way that the creating of children/"positions" is available for guests also. Nothing in this site requires login (the restricting is done by IP address). Could this be the reason?

#1129575

Nigel
Supporter

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

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

Hi Katja

When you have Access installed it affects the availability of forms to guest users.

Before going any further, can you disable Access and see if it affects the parent selector?

Also try removing whatever you are using to impose the IP address restrictions.

Let me know the effect of either of those, so I can see how to proceed.

#1129713

Hi Nigel,

I disabled Access and also the "Restricted site access" plugin (which does the IP thing). No help there. But then it occurred to me that - even this cache plugin WP Rocket is not installed in this particular site in this multisite installation - it could be a cache thing. So I installed WP Rocket and cleared the cache of the site in backend. Now the parent selection works in frontend.

My problem now is how to disable the cache for this site for real. The WP Rocket seems to use the cache somehow anyway even though it's not installed in this particular site.

#1129718

...No, sorry to say I have to take it back. Clearing the cache doesn't help anymore. So I need to dig deeper into this also.

#1129899

Nigel
Supporter

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

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

This is the same site as the other thread?

I'll be able to debug both issues at the same time if I have a copy.

#1129906

Hi Nigel, yes it's the same site. I will create a copy and send you the details. Thank you!

#1133471

Nigel
Supporter

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

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

Let me just mark this as awaiting feedback from you so it's not sitting in my queue. I'm awaiting your comments in the other thread.

#1134039

This child to parent cred form issue is really odd. I added this (found in a thread) to the post form:

<div style="display:none;">
[cred_field field='_wpcf_belongs_parentslug_id' value='[wpv-post-id id='$current_page']' select_text='--- not set ---' class='form-control' output='bootstrap']
</div>

But in frontend there is only this:
<div style="display:none;">
</div>

So for some reason the relation is not assigned or considered in any way at all.

#1134225

Nigel
Supporter

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

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

The code you are looking at there relates to using post relationships made with Types 2, and as you are developing this site with Types 3 I expect you to be using Types 3 relationships.

You can check by going to Toolset > Relationships and see whether your relationships are listed there or whether you see a message to migrate your relationships.

In terms of the form and the parent post selector, if you auto-generate the form markup then the parent select field should be inserted with the correct attributes, and when you see the form on the front-end you should be able to choose from a list of parents. (You may want to pre-select the parent, which is another question, but, first, you should see the parents to choose from.)

#1134233

Hi Nigel,

Well if you just read my original post, you see I can't choose the parent. That's the excact problem. It would be just perfect if you just took a little peak into the site (not forcing me to duplicate this huge multisite because it didn't work as you remember hopefully). So you would understand what I try to explain to you now again.

#1134264

Nigel
Supporter

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

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

I accessed your site with the credentials from the other site.

It took a while to work out which post types, relationships and forms you were referring to, but I'm satisfied I'm looking at the right content.

But when I try to view a Yksiköt post on the front end so that I can see the form it redirects to another site and asks me to log in.

I managed to log in with the same credentials, but the post that loads, I'm not sure what I'm looking at, but I don't see the form anywhere.

If you are creating forms on one site on the network I'm not sure they would be expected to work when showing posts on another site of the network.

#1134877

Sorry Nigel, I had one thing wrong in Broadcast that's why the link didn't work. Now they work ok and clicking the yksikkö link shows you the cred form in single page. At the moment I have there also the relations form because I couldn't make the automatic parents show in the main form. But of course it would be best to have the parent automatically assigned to the child created with the original form.

#1134930

Nigel
Supporter

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

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

I was able to visit a yksikko post on the front end and see the form, and I can see the parent selector and that it is empty, containing no results to choose from.

I tried using FTP to see if debugging were enabled (seemingly not, as I found no debug file) but had problems using it and I couldn't edit the wp-config.php file to turn on debugging.

To be able to identify the problem I would first need to check for errors (there are no JS errors, I cannot check for PHP errors), and if that didn't reveal anything, go through the standard steps to identify any conflicts. That means switching theme to twentyseventeen and disabling *all* non-Toolset plugins and seeing if the issue is still present. If not it should be possible to determine the source of a conflict by a process of elimination.

But I can't do that because I'm not sure if this is a live site (it is always advisable to work on a staging site) and most of the plugins are active at the network level and would need to be disabled across the network.

So I would start with the debug logs.

If you haven't already, turn on the debug log by editing your wp-config.php file and change the line with WP_DEBUG like so:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

That will create a debug.log file in your /wp-content/ directory which you can examine in any text editor. Try visiting a front-end post with the form and then inspect the log to see if there are any warnings or errors.

If that doesn't help then you'll need to either set up a staging site or run tests on the live network.

(I know that there are currently no issues with adding child post forms to the template for a parent post, I just double-checked on a local test site once more and it works as expected. The issue must be particular to your set up, and unfortunately it is a set up that is not very amenable to testing.)

#1137396

Thank you Nigel. I have the debug on now and I try to test deinstalling the plugins. Still no success though.

Below are some Divi related lines. Do you think they have anything to do with this?

[31-Oct-2018 06:02:36 UTC] <unknown file>:<unknown line> array_walk():
You're Doing It Wrong! You're using wrong name for 'affects' attribute. It should be 'auto' instead of '#et_pb_auto'

[31-Oct-2018 06:02:36 UTC] <unknown file>:<unknown line> array_walk():
You're Doing It Wrong! You're using wrong name for 'affects' attribute. It should be 'show_more' instead of '#et_pb_show_more'

[31-Oct-2018 06:02:36 UTC] <unknown file>:<unknown line> array_walk():
You're Doing It Wrong! You're using wrong name for 'affects' attribute. It should be 'auto_speed' instead of '#et_pb_auto_speed'

[31-Oct-2018 06:02:36 UTC] .../builder/class-et-builder-element.php:254 ET_Builder_Element::__construct():
You're Doing It Wrong! Setting definition for auto_speed includes deprecated parameter: 'depends_default'. Use 'show_if' instead.

There are also these lines:

[31-Oct-2018 05:07:16 UTC] PHP Notice: Undefined index: input in /var/mysitepath/wp-includes/kses.php on line 867
[31-Oct-2018 07:11:55 UTC] PHP Warning: Cannot assign an empty string to a string offset in /var/mysitepath/wp-includes/class.wp-scripts.php on line 426

#1137438

Hi Nigel, I have now a development enviroment for testing purposes.

I deactivated all the plugins, the select of parent started to work. But still in a strange manner. It shows all the other parents but not the current parent where the form is. It should do exactly the opposite. The relation should be so that the child has only one parent. Parent can have multiple children.

Then I re-activated all the plugins, the select still works. This is really weird.