I am trying to: figure out what has gone wrong with forms to create posts on my site. I have a post type "Announcements" and have a bundle of problems with this post type. People who own Company profiles on my website can make announcements for thteir company.
The First problem I noticed was that when I click the button to create an announcement for a company with the front end form I started getting a critical error. (the form had been working for years.) I did some experimenting and noticed that the form still works for my own company that has a profile on the website.
To overcome the critical error problem I tried making an announcement from WP-Admin and discovered that the custom fields that used to appear in the editor were no longer there.
I also tested creating an announcement for my company from the front end form which worked fine. When I edited this announcement in the back end the custom fields appeared.
I have tried clearing my sites's cache, which made no difference.
Do you have more details about the critical error that occurred? Do you have the error and call stack from the PHP debug log?
Is the problem with the visibility of the custom fields limited to a particular field group? (You can assign more than one field group to a post type; if you add another field group to the Announcement posts with a dummy field, does that display in the editor normally, or it is also missing?)
Where do I find the error and call stack from the PHP debug log?
I currently don't use field groups... I have fields used exclusively with each post type so all fields for announcements are currently absent... except from existing announcements if I go to edit them or the new posts I create from my company's profile.
It is not possible to use Toolset custom fields without first creating a custom field group, and then adding fields to that field group. You can then assign the field group to some post type.
I logged into your site and went to Toolset > Custom Fields, where I can see that you have 2 custom field groups assigned to the Announcements post type (screenshot).
The first is itself called Announcements, and the second is called Field Group for Announcements. But this second field group is empty, it doesn't include any custom fields, it can be deleted.
Returning to the first field group, I went to the list of Announcement posts and edited the first one ("‘First Mover’ Delloop introduces new eCommerce Concept for Retailers").
Scrolling down I find the Announcements fields, as can be seen in the second screenshot.
So there doesn't appear to be a problem with the custom fields on the back end.
Can you please list the test steps that would be needed to test the front-end form that is producing the error? We can test submitting it, and check for errors. (We will need to add a plugin to be able to turn on the debug log and inspect it, if that's okay.)
I forgot I had the 2 groups... I have deleted the one I wasn't using... "partner announcements"
Yes I can see that the field group announcements is visible as in your second image but when you go to "add new" announcement, the custom fields in the Announcements field group are not visible.
I also attach an image of the most recent announcement made... which show the announcements fields... I did this by starting as an announcement for Techboard and then edited which profile the announcement was to be related to.
In terms of the front end form, I have set you up as owner of two profiles you can view when you visit: hidden link
If you click on the "Make an Announcement" button to the right of each company logo you will see that Yolo's gives you a critical error but Techboard's brings up the front end form as it should.
I checked when creating a new Announcement post in the back end and you are right, the field group was missing.
I went to the list of field groups at Toolset > Custom Fields where it showed that the field group was assigned to two post types, Announcements as well as partner-announcements. But when I edited the field group it showed that it was set to only show for the Announcements post type, so something looked wrong there, and I re-saved the field group.
It nows shows as only applying to the Announcements post type, and when I went to create a new announcement post the field group was shown as expected.
I suspect that was the issue, so I haven't tested trying to publish the front end forms.
If there are still issues with those, let me know and I'll look into them.
OK so 1 down... Back end working... thanks so much.
Front end forms still being weird... Techboard Announcements from Front end works for me as Administrator, but I cannot use front end forms for other companies... I still get the critical error message.
The Front end forms are accessible from the hidden link link or from inside the company profiles... under the company logo see for example hidden link
I tried to create an announcement from the fetch profile and it reported an error.
I added a file manager plugin to your site so that I could check the debug log, and I can see that the error originates in the child theme (sparkling child) functions.php file.
I downloaded that file to see if I could spot the problem, but unusually that file is compressed—you don't normally compress PHP files—making it hard to read and meaning it's not possible to pin-point which line of code is responsible for the error.
Given that this is a live site I suggest you create a copy of the site on a staging server.
I expect that you will find if you switch to the parent theme and re-test the error shouldn't occur.
If the person who developed the child theme is still available hopefully they can identify the cause of the problem.
I have copied the production site onto our test site and can confirm that switching themes has resolved the problem... I will get the developer who worked on the child theme to see if he can sort out the issue.
Thank you.
The topic ‘[Closed] Custom fields not appearing in editor’ is closed to new replies.