Skip Navigation

[Resolved] Can’t edit template page.

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am trying to edit a template page for a custom content type that was created. When I click the link on the dashboard to get to the edit page, it is either leading to a blank white page, or giving a PHP memory limit fatal error.

Solution:

You can display the post body with a Toolset single field block

Relevant Documentation:

https://toolset.com/block-item/single-field/

This support ticket is created 3 years, 3 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: Asia/Hong_Kong (GMT+08:00)

This topic contains 22 replies, has 3 voices.

Last updated by melodyM 3 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2273663

I am trying to edit a template page for a custom content type that was created. When I click the link on the dashboard to get to the edit page, it is either leading to a blank white page, or giving a PHP memory limit fatal error. I have increased the PHP memory limit for the site to 1024MB in the php.ini file but the edit screen still will not load.

Note that I was able to get into this page to start editing it one time, but now it won't let me back in.

I was having another issue with a conflict between your plugin and Elementor that was causing a fatal error on the theme Customize page. I found this page:

https://toolset.com/errata/fatal-error-on-customizer-page-after-updating-to-elementor-3-5/

The patch on that page worked for me. But I was thinking my current problem might be related to Elementor as well. So I deactivated Elementor to test. It still doesn't work.

I do know the site is highly bloated in resource usage from a bunch of plugins our theme had us install to use their demo content. It is likely that this problem stems from that in some way. But we can't remove these plugins yet because I'm still working with the owner of the site to determine what elements of the demo content she wants to keep. So we need to keep those active for now while developing the site.

Can you look at it and determine if you can find a definite cause for the white screens/fatal errors? I have error set to go to a debug log file. When the fatal error happens, it's clearly a PHP memory limit issue. But when the white screen happens, I'm not getting anything added to the debug log file for reasons unknown. I do see errors in the browser console though.

I'm providing admin access to the development site below. Let me know if FTP access is needed. The template I'm trying to edit is Template for Freelancers.

#2274007

Here is the error in the log whenever the fatal error happens when I try to open the edit template page:

[24-Jan-2022 11:29:16 UTC] PHP Fatal error: Out of memory (allocated 251658240) (tried to allocate 131072 bytes) in /home3/slicecre/public_html/development/wp-includes/media-template.php on line 1213

#2274023

Here is what I'm seeing in red in the console when I don't get the fatal error but do only get a white screen instead of the template edit page. I have no idea what might be causing these issues:

rich-text.js:1905 Format "core/code" is already registered.
registerFormatType @ rich-text.js:1905
rich-text.js:1905 Format "core/strikethrough" is already registered.
registerFormatType @ rich-text.js:1905
rich-text.js:1905 Format "core/subscript" is already registered.
registerFormatType @ rich-text.js:1905
rich-text.js:1905 Format "core/superscript" is already registered.

...

Uncaught TypeError: Cannot assign to read only property 'className' of object '#<Object>'
at ba.<computed> (index.js:2:236872)
at index.js:2:746784
at runHooks (hooks.js:450:39)
at getSaveElement (blocks.js:3874:55)
at getSaveContent (blocks.js:3892:57)
at addParsedDifference (block-editor.js:13440:69)
at runHooks (hooks.js:450:39)
at getBlockAttributes (blocks.js:5269:52)
at createBlockWithFallback (blocks.js:5512:33)
at blocks.js:5592:17
react-dom.js:19662 The above error occurred in the <EditorProvider> component:
in EditorProvider
in Unknown (created by Context.Consumer)
in WithRegistryProvider(EditorProvider) (created by Editor)
in slot_fill_provider_SlotFillProvider (created by Provider)
in provider_SlotFillProvider (created by Provider)
in Provider (created by Editor)
in StrictMode (created by Editor)
in Editor

Consider adding an error boundary to your tree to customize error handling behavior.
Visit hidden link to learn more about error boundaries.
logCapturedError @ react-dom.js:19662
react.js:2210 Uncaught TypeError: Cannot assign to read only property 'className' of object '#<Object>'
at ba.<computed> (index.js:2:236872)
at index.js:2:746784
at runHooks (hooks.js:450:39)
at getSaveElement (blocks.js:3874:55)
at getSaveContent (blocks.js:3892:57)
at addParsedDifference (block-editor.js:13440:69)
at runHooks (hooks.js:450:39)
at getBlockAttributes (blocks.js:5269:52)
at createBlockWithFallback (blocks.js:5512:33)
at blocks.js:5592:17
index.js?ver=230000:2 Uncaught (in promise) TypeError: Cannot assign to read only property 'className' of object '#<Object>'
at ba.<computed> (index.js:2:236872)
at index.js:2:746784
at runHooks (hooks.js:450:39)
at getSaveElement (blocks.js:3874:55)
at getSaveContent (blocks.js:3892:57)
at addParsedDifference (block-editor.js:13440:69)
at runHooks (hooks.js:450:39)
at getBlockAttributes (blocks.js:5269:52)
at createBlockWithFallback (blocks.js:5512:33)
at blocks.js:5592:17

#2274027

Note that whether I get the fatal error or just the white screen seems inconsistent with nothing that I can tell to predict which one will happen. I'm not getting to the edit template page at all any more though.

#2274051

Nigel
Supporter

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

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

Hi there

I visited your site briefly and ran into the same problem of a fatal error when I try to edit the template for freelancers.

I assume it is the same out-of-memory error.

I did find that I was able to create a new template (at Toolset > Content Templates). I don't know what content the existing template contains and whether that may be an issue. It may be a good idea to delete the existing template and create a new one.

As a general observation there are a great many plugins installed and active on your site, which appears bloated, and so it is to be expected that it may run into server issues.

I'd recommend deactivating (temporarily) all plugins except for Toolset and seeing if things work as expected.

Then judiciously re-activate only the plugins you need.

And don't forget that in wp-config.php you specifically need to set the WP_MAX_MEMORY_LIMIT constant for the memory allocation available on admin pages.

#2274075

OK, I'll try deleting and creating a new one.

Agreed that there are wayyyyy too many plugins and that several of them are resource hogs that the theme had me install. I just can't determine which ones are really needed yet because I'm waiting to have a phone conference with the site owner to go through all the elements present in the theme's demo content to see exactly what she wants to keep. I've never had to increase memory limits beyond 512MB before and even that is extremely high IMO. Having to go to 1024MB is absurd, but that didn't solve it either.

I guess I'll deactivate ones that aren't needed *right now* to where I can still use Toolset for editing these templates that I'm trying to work on now. Then I'll reactivate them when I'm done editing these templates.

Please leave this thread unresolved for the moment while I go through everything just in case I'm able to determine exactly what is causing the problem and find that it is something you should be made aware of. If it turns out to be unrelated to Toolset at all, I'll let you know that as well. That's likely to be the case.

I've never done anything with WP_MAX-MEMORY_LIMIT in wp-config.php. This is the first time hearing this. Is that a setting that is specific to admin pages? If so, then that would make sense why increasing the regular memory limit to 1024MB didn't work. Here's what I'm currently using:

define( 'WP_MEMORY_LIMIT', '1024M' );

I've found a page detailing this here:
hidden link

So now I've added

define( 'WP_MAX_MEMORY_LIMIT', '1024M' );

to the wp-config.php file. But that hasn't solved the problem either.

I've now deleted the Freelancer template and am building a new one. That worked, but when the edit screen comes up, I'm seeing a black box at the lower left corner that says "Processing server request, please wait". It does go away though. Is that normal?

I'm now on the edit screen setting up all the fields we want. but I'm now encountering a problem where the edit screen seems to be stuck saying "Saving". The Update button is showing "Updating..." but I can't click it. The word saving is pulsing, but it isn't finishing saving it. This happened after I used the Drag feature to move a field from one spot to another in what I was setting up. Is this related to the memory issue?

I guess I'll just deactivate many plugins and see if it works better. Don't worry about checking anything further on it for me until I do that, but if you could provide answers to anything asked here, that would help.

#2274077

Note that this same thing happened on my first effort with this template. It got stuck on Saving before as well. I'm thinking that might be why I can't get back in to edit it afterwards. I don't think it's completing the process of Saving for some reason. This is confirmed now. I went out of the edit page when I couldn't do anything else because it was stuck Saving. Now when I try to go back in to resume editing, I'm getting the white screen again.

I'll let you know what happens when I deactivate some of the resource hog plugins. But if this matter of it getting stuck on Saving persists, I'm thinking that's the problem here.

#2274089

Oh wait, I just thought of another possibility. The problem may have happened after I added a custom field for Address. We do not yet have the API key set up for Toolset Maps. Is there any possibility that might be causing an issue here? All we have on the one freelancer in the system so far is a city, state combination. We don't have an actual street address in there. Could that be causing a problem in any way using that field without the API key? The reason we don't have the API key right now is because the site owner indicated she didn't want to have mapping on the site, but I found that the custom field for Address only exists as an option when Toolset Maps is activated. We want to have an Address field, but we will only display the address as text, not as markers on a map. I guess I could just set up a text field and call it Address. I just thought it would be better to use your actual Address field in case there were other advantages to doing so that we might realize later.

It's possible this has nothing to do with the white screen error though. Not sure.

#2274123

OK, new update. I've deactivated many of the resource hog plugins, but not all plugins. I set up all the fields we want on the Freelancer template and did not encounter the problem with it getting stuck on Saving. I then exited the editor page by clicking the WordPress W logo in the top left corner. I then went to the Toolset Dashboard page. I then tried to re-enter the Edit page for the Freelancer template. It's still only showing the white screen again now.

So the problem is not because of it getting stuck on Saving. The problem happens after I finish an editing session, go out, and then try to get back in to edit further.

I guess I will try to deactivate all plugins next and then see if one of them is causing the problem. More info in a little while after I do this.

#2274125

Note that something else is wrong. I successfully added all the fields we wanted on the template and saved it. But when I go to the freelancer page that should be using this template, it is not displaying all the fields.

hidden link

This should have all the fields that are in the Field Group for Freelancers.

So something is not working properly even at that level. I would guess that the problem there probably relates in some way to the problem where we're getting the white screen though. Something might not be working right with saving the edits. When I set up this new template, I made sure to hit the Update button after I added every field. I made sure it saved properly and didn't get stuck. It did not get stuck on any field, including the Address field. The only indication of a problem came after exiting the editor and then trying to get back into the editor.

#2274139

I have now deactivated all but 14 plugins on the site. The only ones still active are:

Child Theme Configurator
Customizer Search - one that the theme wants active
Jetpack
Kirki Customizer Framework - one that the theme wants active
Riode Core - A plugin for the theme
Toolset - 8 different Toolset plugins
Woocommerce - one that the theme wants active

That's it. Everything else is deactivated and I'm still getting the white screen when trying to go back in to edit the template.

I could try using a different theme if you think that might be the problem.

#2274633

Hello,

I assume you are going to display the post body in the content template, please try the Toolset single field block:
https://toolset.com/block-item/single-field/

And I have setup a demo in your website:
1) Trash the content template "Template for Freelancers 1"
2) Create another content template "Template for Freelancers 2":
hidden link
Display the post body with a Toolset single field block, it works fine in both frontend and backend.

Please check if it is fixed in your website, thanks

#2274675

This looks like it is working to display the fields properly and on this occasion I'm still able to get back into the template to edit it after I save it and exit the editor. I'm not getting the fatal error or the white screen on this.

I was able to re-activate all the plugins we need and I'm still not getting the fatal error or whitescreen.

I'm not sure how whatever I was doing differently in setting up my version of the template would be the cause of the issue I was having, but it appears that's the case based on these results. I'll use the single field block going forward. The way I was setting up the fields before was I put my cursor where it says "Type / to choose a block" and I would choose the Inline Field option. I'd set that to show the field, but then I was confused because I then saw that there were settings for the field in the right column of the editor screen. I'd then reset the field in the right column by turning on "Dynamic Sources | Content" and then choosing the field again there. I wasn't sure what the right way to do it was there, so I'd set the field in both spots. After adding the first block/field, I'd click the three vertical dots button for options and I'd then choose Insert After to set up the next block that way. Something with how I was doing things there must have caused the fatal error/white screen, but I can't imagine what would cause that. I did it the same way on another site I'm developing and it worked fine there. Something is different on this site, and I'm thinking it's something with the theme.

But now I see that I can add a block with the black + button and the single field option is present there. I'll use that approach going forward to hopefully avoid whatever is causing the problems. I wish I knew what the actual cause of the problem was though. This is now a "Can't argue with success" situation where I don't know why it's working this way or why it didn't work the other way. So I'll stick with what works.

Thanks for the help here.

Please leave this ticket active for a little bit longer as I work on it some more. I have to add a lot of HTML code for how we want everything to display with all the fields and I want to make sure nothing I do with that brings back the fatal error / white screen problem before I consider this issue resolved. If I have any other issue going forward that is not related to the fatal error / white screen issue, I'll create a separate ticket for that.

#2274721

When I started deeper editing on the template, I realized that much of the demo content to our theme was no longer displaying. I have no idea what happened there. Did you modify anything with that in getting the template to work?

So I uninstalled the demo content and reinstalled it. This caused me to lose hours of customizing work I had already done.

But now, after reinstalling the demo content, I'm trying to edit the template further and now I'm having the problem where it won't complete the Saving process. The Saving text is pulsing and the Updating... button is grayed out.

I have a feeling I'm not going to be able to edit the template again now. I'm going to exit the editor. OK, I'm wrong. I am able to edit still. Some of my edits previously done have to be redone as they didn't save. But not much was lost.

I've now restored what was lost and am editing the styling/display of more of the fields and the Saving feature is again stuck. I have no idea why this is happening, but it seems to be related to the same overall problem I initially reported in some way, so I'm going to leave this in this ticket rather than starting another. Can you determine why the Saving feature isn't finishing?

Now I'm also seeing that not all of my edits are displaying on the Freelancer page the way they are set up in the Template editor. Is it possible that the theme demo content is the problem here? Is the theme demo content interfering with the Toolset template? Examples:

1. What is displaying in the template editor as

Attraction Designer
Graphic Designer
Signage Designer

Is displaying on the page as :
Attraction Designer<br>Graphic Designer<br>Signage Designer

Is there another way to separate the display of taxonomy terms to make them appear on separate lines other than <br> code?

2. The bold, black "Melody Matheny" text in the editor is displaying as less bold and gray text on the page.

3. The bold "Orlando, FL" text in the editor is displaying as not bold on the page.

4 There are two sets of AddtoAny social sharing buttons on the page, one if which is above the website field and social media URL fields from the template. I have no idea how or why this second set of the sharing buttons is being added in this spot. I understand why the second set below the content is showing as we have those set to display on all pages, but not this first set in between fields from the template.

5. The Featured Image from the Freelancer post is displaying above the template content from Toolset. I previously set custom CSS that blocked that from displaying here: .type-freelancer .post-media img {display: none;} . That was working before, but now it is no longer working after I brought back the theme demo content.

This is highly confusing. I'm sorry this theme is evidently causing so much conflict with your plugin. I don't know what to do to fix the situation.

#2274723

I have marked this thread as "Waiting for feedback" status, you can update here if need more assistance for it, thanks