• Resolved andersjytzler

    (@andersjytzler)


    Hey guys,

    I had ACF and CPT UI installed, and made a field group in ACF and then installed ACF Pro. Then i created a Custom Post Type in CPT UI, and suddenly got the errors below. I have searched the world wide web thin for a solution, but i can’t find any. I hope you can help me šŸ™‚
    I tried changing theme to Twenty-Twenty-One, without success. Error disappears when i deactivate CPT UI plugin.

    Warning: Invalid argument supplied for foreach() in /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php on line 930
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php:930) in /var/www/west-marine.dk/public_html/wp-includes/functions.php on line 6362
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php:930) in /var/www/west-marine.dk/public_html/wp-admin/includes/misc.php on line 1310
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php:930) in /var/www/west-marine.dk/public_html/wp-admin/admin-header.php on line 9

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Seems like we’re not getting an array of post types for some reason for a utility function meant to handle post_format support details.

    Is this happening every time you click save on CPTUI settings? Or is it happening only when trying to publish a post? in which I wonder if clicking save on your post type(s) in CPTUI would somehow help.

    Thread Starter andersjytzler

    (@andersjytzler)

    Hello @tw2113

    I get the errors in the initial post on every page.
    When i go to the CPT UI > Add/Edit Post Types > Edit Post Types, i get these errors also:

    View post on imgur.com

    If i try to add a new post type i get this:

    Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/post-types.php on line 1884
    
    Warning: Illegal string offset 'test' in /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/post-types.php on line 1717
    
    Warning: Invalid argument supplied for foreach() in /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php on line 930
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/post-types.php:1884) in /var/www/west-marine.dk/public_html/wp-includes/functions.php on line 6362
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/post-types.php:1884) in /var/www/west-marine.dk/public_html/wp-admin/includes/misc.php on line 1310
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/post-types.php:1884) in /var/www/west-marine.dk/public_html/wp-admin/admin-header.php on line 9
    Thread Starter andersjytzler

    (@andersjytzler)

    I didnt notice before, but i also get this error, on frontend when CPT UI is activated, and only white blank page:

    Warning: Invalid argument supplied for foreach() in /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php on line 930
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php:930) in /var/www/west-marine.dk/public_html/wp-includes/pluggable.php on line 1329
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/www/west-marine.dk/public_html/wp-content/plugins/custom-post-type-ui/inc/utility.php:930) in /var/www/west-marine.dk/public_html/wp-includes/pluggable.php on line 1332
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Something isn’t saving right, for some reason, and I don’t know why exactly.

    How many post types and taxonomies do you have thus far, and how many have a lot of content in them?

    I’m wondering if we could easily just wipe out the CPTUI settings, and re-start. Doing so would not delete the posts or the terms associated with what you registered, but they would be “down” temporarily.

    I can provide you with a very small string of characters to use on the CPTUI Tools menu to import to wipe out previous settings and try again. Biggest thing to note down and remember would be the slugs used for everything.

    Thread Starter andersjytzler

    (@andersjytzler)

    I dont think i even managed to save one post type or taxonomy type. Wiping them should be fine. How would i go about that?
    When i check the dropdown in Edit post types, it’s empty.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Go to our Tools menu, and then with both the post types tab, as well as the taxonomies tab, import the following:

    {""}

    Both curly brackets and then the empty quotes inside. This should wipe out the settings saved and allow you to try again.

    For ease of testing, lets just fill in the slugs, plural, and singular labels for both, and then choose “post” for the post type to attach a taxonomy to. Don’t worry about any of the other settings just yet. This will see if we can get the bare minimum saved and errors gone. Once done, we can edit the settings afterwards.

    Thread Starter andersjytzler

    (@andersjytzler)

    Hey Michael,

    It seems to be working now. After i just added the
    {""}
    to the post types import and not taxonomy. But i added to both anywho, just to be safe.
    Thanks for your help šŸ™‚

    //Anders

    • This reply was modified 5 years, 2 months ago by andersjytzler.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome.

    As a brief explanation of what that did, it imported the minimal valid amount of JSON into our settings, and internally I check for that string specifically. If it is submitted, I basically delete our 2 options that store post type and taxonomy settings, allowing to start fresh. Saves people from having to try and fiddle directly with the database.

    Let us know if you need anything else

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘I get error invalid argument’ is closed to new replies.