Skip Navigation

[Resolved] Cannot add new item in custom post type. Page fails to load.

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

Problem:
When trying to add new posts of a custom post type a "This page isn't working" error occurs.

Solution:
Site uses Divi together with Toolset and requires reasonably high memory allocation.

The PHP logs show an out-of-memory error.

The WP_MAX_MEMORY_LIMIT setting needs upgrading in the wp-config.php file.

Relevant Documentation:
https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

This support ticket is created 5 years, 10 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by benG-14 5 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#1220864

I am trying to:
Add a new item under my new custom post type created with Toolset.

When I try and add a new item, I get a 'This page isn't working' error page. I have created multiple custom post types to try this and the issue persists.

I can view the 'All items' page, but as soon as I click 'Add New' I receive the error.

Thanks in advance for any help.

#1220904

Nigel
Supporter

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

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

Hi Ben

I would expect to see a PHP warning or error that might be informative in the error 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 adding a new custom post and then inspect the log. If you don't find the debug.log file it means it didn't generate any warnings or errors.

You can also try to rule-out conflicts before proceeding.

Disable all non-Toolset plugins and switch theme to twentynineteen then try again. If the issue disappears then it should be possible to determine the source of any conflict by a process of elimination.

Let me know how that goes so I can see how to proceed.

#1220940

Hi Nigel, thanks for this.

It looks as though it's a php memory limit causing the issue, and disabling the Divi theme then allows the plugin to work correctly.

Is there anything I can do to get it to work in conjunction with Divi?

Thanks

#1220955

Here is the latest error log.

PHP Fatal error: Out of memory (allocated 167772160) (tried to allocate 1343488 bytes) in /home/sites/adstest.co.uk/public_html/hugomangos/wp-content/plugins/types/vendor/otgs/installer/includes/class-otgs-installer-autoloader.php on line 13

#1220972

Nigel
Supporter

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

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

Well, some plugins and themes are more demanding of memory than others, and both Toolset and Divi would lean towards the heavy end of the scale.

Still, most people use Toolset alongside with Divi without any problems.

Can you upgrade the memory settings for your site?

WP_MEMORY_LIMIT is the default limit for the front-end, so in your case you will want to increase the setting for WP_MAX_MEMORY_LIMIT which affects the admin pages.

See the codex for details: https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP

#1226415

Thank you, the resolution was to revert back to an older version of Views. For some reason, this was causing a clash with the Divi theme.