Home › Toolset Professional Support › [Resolved] Unable to select parent when creating a child post
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 |
---|---|---|---|---|---|---|
- | - | 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)
Related documentation:
This topic contains 15 replies, has 2 voices.
Last updated by Beda 5 years, 10 months ago.
Assisted by: Beda.
I am trying to select a parent when creating a child post.
Link to a page where the issue can be seen: hidden link
I expected to see the two parent posts that I have created in the Transport District select drop-down.
Instead, I get no values in the select.
I followed this process but it's not working: https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/
I see the issue, and I see that your backend is set up to have a relationship each (o2m) between the students and schools, and students and districts, but when I edit a student in the backend I cannot see this connection, which should be there.
Is this intentional?
I think there is something broken generally with the relationships here, as I should be able to connect them, in the backend.
This would explain why the Form you mention, also is broken.
Usually, there should appear either a Select2 or a select with the possible posts to choose from.
This as well works properly locally, hence it must be something specific to this site.
I would suggest checking and excluding other plugins and the theme or custom code, and if then the issue persists, also try with a test freshly saved relationship and form.
If that all does produce the same results, I have to look at this locally, spot the issue and eventually propose a solution to you or report it back to the developers.
For this I need a duplicate of the site, in case no solution can be found with above steps.
https://toolset.com/faq/provide-supporters-copy-site/
Could it be you use Private Posts?
https://toolset.com/forums/topic/relationship-select-box-in-cred-form-wont-show-private-posts/
(As far I saw on your site, not, however just to be sure)
Hi Beda
This is a freshly-created relationship and form - I literally was blocked at the first record I tried to enter, so I don't think that new versions will help.
Before I tackle the plugin/theme conflict possibility, here are three observations:
1. I can most definitely assign the relationship in the backend, as illustrated on the attachment
2. When I was doing data-entry last night on two occasions (from 300 records) I was able to select the School relationship on the front-end form
3. I stumbled across the Relationships Form and have been able to assign relationships
4. I'm logged in as SuperAdmin and data entry is happening under my login, so I don't think it's to do with access or private posts
In summary, the back end works for me and not for you, and it's possible to make -something- work in the front-end, just not this form.
Is it possible that this is an Access problem? I have another issue where I can't get an Edit link to show on the Student record unless logged in as an administrator. Could these issues be connected?
Indeed you use Toolset Access, which has influence over what you will be able to do and see, also on relationships.
Some of the involved post types are controlled by Access, others use native post permissions.
Also, the Toolset Forms are controlled by Access, in the site.
However, an Administrator (a native Administrator) should be able to always use and connect and edit those, as there is no restriction on them.
I tried to find out what's going on but was confused.
In the page you call a Form [cred_form form='apply-for-help-getting-to-school' form_name='Add a student']
That form is not present on the system, neither as a post, user or relationship form.
I assume you mean to insert [cred_form form="add-student-by-administrator"]?
That Form creates students, which properly should offer a selector to choose an existing parent school.
That should be [cred_field field='@school-and-student.parent' class='form-control' output='bootstrap' select_text='--- not set ---'], or with bootstrap, as you chose it.
To proceed here, I would need to start with removing interference from other software, then re-inserting the forms shortcodes which seem different from automatically generated ones, and from there go forward removing, re-adding toolset features such as control of Access, but also single aspects in the form itself.
All this reflects on the front end, hence a local test is better.
I can do this online if you have an adequate test instance, otherwise, can you provide a copy of this for me to test several things that can break the online appearance?
Hi Beda
I'm confused too. "Apply for help getting to school" was certainly in my Toolset system from a few years back but I thought I had purged all of those references.
And when I view that page in backend it looks exactly as it should - the shortcode I'm using is [cred_form form="add-student-by-administrator"] - I can't see "Apply for help getting to school" anywhere.
I'm having a problem with Duplicator - timeout error. Would you prefer to login and have a look?
Kind regards,
Greig
I should add that whilst this site may be in production, my clients are aware that it is under development and that there may be glitches. Downtime is to be expected...
According to this, I suspect we are not looking at the same place.
I was looking at the page hidden link, but that might be wrong.
Currently, the password for the submitted access here has become invalid, can you control them?
I had already logged in, so to spot the previously mentioned issues, and could try to proceed further on the online site before we try duplicating it again, given the plugin fails (we can try All in One, or others, if necessary).
Please however acknowledge that this can temporarily remove forms and change look/appearance of the pages and forms in question, as well it may be necessary create new dummy content, which has to be shortly published (we can trash or draft it later).
Only with explicit permission, I can do this, otherwise, we need to do this locally or on a test site.
If required, I can try personally with the All in one migration plugin.
Another method can be to send me database dump and zip of the FTP (that's simple to get thru your hosting interface and php my admin, for example)
I activated a few private forms, please let me know what's more convenient for you.
Thanks, the login works again.
I looked at the relationship Schools to Students and according to the settings, I should be able to connect many Students to the same common parent school.
hidden link
However, editing a single school or student does not allow me to do so.
I see however as well that your maximum current connections are 195, as seen as the minimum possible when editing the relationship, so there must be some and it must be the user I use which is not seeing those posts, hence depending on access of that user.
I tried adding a new user, however, I cannot set its password.
Could you either upgrade my user to Administrator or create a new one with that native role?
I do not see the relations on the single post type, and I see those are controlled in Access.
I cannot disable Access, as it's enabled network wide.
Creating a new post type + new relationships and not controlling them by Access, led me to another issue on the site (under the Toolset > Post Types > Add new)
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in .../wp-content/plugins/types/vendor/toolset/types/includes/classes/class.types.admin.fields.php on line 664
This can be solved with https://toolset.com/errata/php-7-3-shows-warnings-about-continue-statement-in-types/, FYI.
However - I can create the post types (Named "Toolset Test..") and it's relationships:
hidden link
I can add Forms for it:
hidden link
I can insert and use that form:
hidden link
I cannot choose the parent posts on the field, however.
On a local test, the exact same setup works.
Of course, there are differences, like mine is not multisite, while you work on a multisite (however I do not think this is the issue).
I rather suspect something with another plugin or theme is interfering, or a very specific Access setting for my own role the user covers on the site.
The latter can be avoided by setting up a new administrator.
The first, by disabling plugins and themes, however, this is not possible on a network as site admin (unless activated single).
Lets first make sure the user is not corrupted (can you set up a new admin?)
Then, if that does not resolve it completely (likely it does not) we need to start removing interfering software, given I cannot find the steps to the issue on any other install.
I see on your install's HTML that the source of the form is all messed up with unwanted, encoded characters.
Means, the data-wpt-id="cred_form_8995_1_cred_form_8995_1-select-1-1548843534" data-wpt-name="@toolset-test-type-toolset-another-test.parent" is printed as URL encoded characters.
This is definitely not the case locally, and it is what breaks the select2 instance there.
I will ask my colleagues if they know a reason why this could happen, however, I would tip on 2 things
- other software,
- some code or application that over escapes or sanitizes things
- other, yet to find
Can we try with the new user for starters?
Hi Beda
This is really confusing, and I'm wondering if the best strategy is just to purge everything and start again.
I'm confused because:
1. you could see things that I couldn't see (e.g. apply for assistance form)
2. the login didn't work and then worked (I didn't change password)
3. You can't assign a student to a school in the backend, but I can
4. Maximum connections are 195, but I set the connections to unlimited
5. Your user was granted Super Admin privileges on the network but you couldn't create a new user or disable plugins (I'm logged in to your user on a different browser and CAN do those things)
6. I don't know how to control relationships with Access
By way of history, I started this build a few years ago to learn Toolset and then put it down. Last month I cloned the whole site to a sub-domain and created new CPTs there (am not using the old CPTs on that site). Then I came back to the original and I'm starting again with a new data structure in mind. So I've been trying to delete almost everything old and start from new.
It would make sense that Toolset is confused. I only have 300 student records, is it better to save that data and just blank everything else and begin again?
If not, I have created a new user: toolset, same password as before.
Many thanks,
Greig
I was able to log in, but this time it's worse, I cannot visit any page but the profile.
It asks me to setup 2F authentication, maybe it is that.
However, the points you outline before can lead to 2 possible issues only:
- either I am looking at another site
- or my user role/user is another user and cannot see the same as your user.
Browsers or ISP or Toolset cannot change the appearance of entire slugs or meta boxes on a browser or ISP basis, which is the only difference left if we assume user and site to be the same.
My colleagues had no input on the encoding issue I noticed on the form.
I asked them as well to log in and confirm what I see, and made as well a screengrab of the latest situation:
hidden link
My best chance here to fix everything is to work locally on a copy, this requires taking apart the software and narrow down the core issue - it has irreparable effects on sites and duplicates for this reason afterwards are thrown away by us.
I am not sure how big in size the entire site is. Duplicator PRO (I have access to it) could help to duplicate it but if it's big, we better would start with a Database dump and a copy of the FTP.
Please let me know what path you prefer, I can try with Duplicator (if I have the right to add plugins and activate them, plus remove them later again)
Or, you can send me thru Google Drive the zip of the FTP (wp-content should be enough, however, best is the entire WordPress install files inclusive wp-config etc), and a zip of the exported database (PHP myAdmin allows that, and it's available either as a plugin or as server cPanel instrument).
I activated the adequate private replies
Hi Beda
The easybus.nz site is the one with the problems. There are only 300 records so it's really no trouble to start again. Aside from these multiple issues reported in this post, Minesh is working on a problem with Google map coordinates plus I am yet to add a new ticket which would read something like "the only way I can edit a post is if my user is an administrator." I'm guessing this may be problems with Access? In other words, I have taken five steps down the development path with easybus.nz and three of them are failing. Who knows how many problems lie ahead?
The katikati.easybus.nz website has no such problems and has about 600 records. I cloned that site from easybus.nz (before commencing the current development program) and then created a new post type called Registrations. All of the post types and relationships and maps work just fine on that site, which leads to believe that my efforts in 'stripping back" easybus.nz to start again have broken something.
Please feel free to take copies with Duplicator Pro.
I cannot upload or use the plugin, as the user still redirects to the profile page, I confirmed this as well again with my colleagues.
Minesh is off today, hence I cannot ask him personally.
The tickets with him did not feature log in details, hence I assume he was working on issues from the front end point of view.
Now, if it's possible to instantiate a user with which I can upload plugins and use them, I can take a copy and see what's wrong.
You will probably want to move on with this, and in this case, what I personally would do is this:
- get the closest possible backup or copy of this site which you know to work.
(For example, if you have no exact backup of working versions, get a copy of the working website katikati.easybus.nz and start there)
- from the backup or copy, set up a staging site and make sure everything is working as expected, plugins are updated, systems ready to go
- now, if I understand it correctly, the only difference from katikati.easybus.nz to easybus.nz is that on katikati.easybus.nz, some content was added? If this is correct, we should not have a lot of steps until reaching the desired state of easybus.nz.
If you can produce a staging site with the starting (working) setup, I can later help you make the changes as required.
Doing so, we will either immediately recognize when the issues start to happen (as we will closely record this), or, we will have no issues, and in that case you could then move on, otherwise, we would create a report and inform the developers, additionally to trying to find a workaround or hotfix.
I think, the issue with the google maps you mean, is this?
https://toolset.com/forums/topic/google-address-not-resolving-correctly/
I am handling that already now on the Second Tier level and could confirm that particular issue, I already escalated it.
It's a strange problem, Luo will update you with some findings.